mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Make use of the Module#public_method_defined?.
This commit is contained in:
+2
-4
@@ -29,10 +29,8 @@ module Liquid
|
|||||||
|
|
||||||
# called by liquid to invoke a drop
|
# called by liquid to invoke a drop
|
||||||
def invoke_drop(method)
|
def invoke_drop(method)
|
||||||
# for backward compatibility with Ruby 1.8
|
if self.class.public_method_defined?(method)
|
||||||
methods = self.class.public_instance_methods.map { |m| m.to_s }
|
send(method)
|
||||||
if methods.include?(method.to_s)
|
|
||||||
send(method.to_sym)
|
|
||||||
else
|
else
|
||||||
before_method(method)
|
before_method(method)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user