Class: Code::Node::Equal
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::Equal
- Defined in:
- lib/code/node/equal.rb
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(equal) ⇒ Equal
constructor
A new instance of Equal.
Constructor Details
Instance Method Details
#evaluate(**args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/code/node/equal.rb', line 10 def evaluate(**args) right = @right.evaluate(**args) context = args.fetch(:context) if operator if context[left] context[left] = simple_call(context[left], operator, right, **args) else raise ::Code::Error::UndefinedVariable.new("#{left} is undefined") end else context[left] = right end end |