introduce to_liquid_value on variable look and conditional statements

This commit is contained in:
Michael Go
2021-05-26 17:27:18 -03:00
parent b9e0d28729
commit e361a4d53c
7 changed files with 100 additions and 4 deletions
+8
View File
@@ -81,5 +81,13 @@ module Liquid
rescue ::ArgumentError
nil
end
def self.to_liquid_value(obj)
# Enable "obj" to represent itself as a primitive value like integer, string, or boolean
return obj.to_liquid_value if obj.respond_to?(:to_liquid_value)
# Otherwise return the object itself
obj
end
end
end