Class: AssignNode
Instance Attribute Summary
Attributes inherited from UnaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(id, subTree) ⇒ AssignNode
constructor
A new instance of AssignNode.
Constructor Details
#initialize(id, subTree) ⇒ AssignNode
Returns a new instance of AssignNode.
21 22 23 24 |
# File 'lib/ast.rb', line 21 def initialize(id,subTree) super(subTree) @id=id end |
Instance Method Details
#evaluate ⇒ Object
26 27 28 29 30 31 |
# File 'lib/ast.rb', line 26 def evaluate val = @subTree.evaluate $calc.insert(@id,val) #realizar asignacion return val end |