diff --git a/lib/liquid/drop.rb b/lib/liquid/drop.rb index c1914dc3..ee2a4d71 100644 --- a/lib/liquid/drop.rb +++ b/lib/liquid/drop.rb @@ -22,6 +22,8 @@ module Liquid class Drop attr_writer :context + EMPTY_STRING = ''.freeze + # Catch all for the method def before_method(method) nil @@ -29,7 +31,7 @@ module Liquid # called by liquid to invoke a drop def invoke_drop(method_or_key) - if method_or_key && method_or_key != '' && self.class.public_method_defined?(method_or_key.to_s.to_sym) + if method_or_key && method_or_key != EMPTY_STRING && self.class.public_method_defined?(method_or_key.to_s.to_sym) send(method_or_key.to_s.to_sym) else before_method(method_or_key)