We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6981305 commit 8660501Copy full SHA for 8660501
lib/liquid/variable_lookup.rb
@@ -32,6 +32,10 @@ def initialize(markup)
32
end
33
34
35
+ def lookup_command?(lookup_index)
36
+ @command_flags & (1 << lookup_index) != 0
37
+ end
38
+
39
def evaluate(context)
40
name = context.evaluate(@name)
41
object = context.find_variable(name)
@@ -55,7 +59,7 @@ def evaluate(context)
55
59
# Some special cases. If the part wasn't in square brackets and
56
60
# no key with the same name was found we interpret following calls
57
61
# as commands and call them on the current object
58
- elsif @command_flags & (1 << i) != 0 && object.respond_to?(key)
62
+ elsif lookup_command?(i) && object.respond_to?(key)
63
object = object.send(key).to_liquid
64
65
# No key was present with the desired value and it wasn't one of the directly supported
0 commit comments