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