mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 15:30:39 -07:00
Make before_method work more like method_missing
This commit is contained in:
+6
-4
@@ -28,10 +28,12 @@ module Liquid
|
||||
end
|
||||
|
||||
# called by liquid to invoke a drop
|
||||
def invoke_drop(method)
|
||||
result = before_method(method)
|
||||
result ||= send(method.to_sym) if self.class.public_instance_methods.include?(method.to_s)
|
||||
result
|
||||
def invoke_drop(method)
|
||||
if self.class.public_instance_methods.include?(method.to_s)
|
||||
send(method.to_sym)
|
||||
else
|
||||
before_method(method)
|
||||
end
|
||||
end
|
||||
|
||||
def has_key?(name)
|
||||
|
||||
Reference in New Issue
Block a user