Make use of the Module#public_method_defined?.

This commit is contained in:
thedarkone 2011-01-29 00:02:05 +01:00 committed by Tobias Lütke
parent a65c4f51bc
commit f7ff9c81d3

View File

@ -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