lib/code/node/left_operation.rb in code-ruby-0.13.1 vs lib/code/node/left_operation.rb in code-ruby-0.14.0

- old
+ new

@@ -9,10 +9,11 @@ attr_reader :operator, :statement def initialize(parsed) return if parsed.blank? + @operator = parsed.delete(:operator).presence @statement = Statement.new(parsed.delete(:statement).presence) end def call? @@ -20,10 +21,11 @@ end end def initialize(parsed) return if parsed.blank? + @first = Statement.new(parsed.delete(:first).presence) @others = parsed.delete(:others).presence || [] @others.map! { |operator| Operator.new(operator) } end @@ -32,15 +34,13 @@ @others.reduce(first) do |left, right| if right.call? right.statement.evaluate(**args, object: left) else - statement = right.statement.evaluate(**args) - left.call( **args, operator: right.operator, - arguments: [::Code::Object::Argument.new(statement)] + arguments: Object::List.new([right.statement.evaluate(**args)]) ) end end end