Refactor Condition so that it takes a parsed expression.

This commit is contained in:
Dylan Thacker-Smith
2014-10-18 15:03:40 -04:00
parent d502b9282a
commit a1a128db19
4 changed files with 69 additions and 69 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ module Liquid
#
# Example:
#
# c = Condition.new('1', '==', '1')
# c = Condition.new(1, '==', 1)
# c.evaluate #=> true
#
class Condition #:nodoc:
@@ -28,9 +28,9 @@ module Liquid
attr_accessor :left, :operator, :right
def initialize(left = nil, operator = nil, right = nil)
@left = Expression.parse(left)
@left = left
@operator = operator
@right = Expression.parse(right)
@right = right
@child_relation = nil
@child_condition = nil
end