Class: AddNode
- Inherits:
-
BinaryNode
- Object
- BinaryNode
- AddNode
- Defined in:
- lib/ast.rb
Instance Attribute Summary
Attributes inherited from BinaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(left, right) ⇒ AddNode
constructor
A new instance of AddNode.
Constructor Details
#initialize(left, right) ⇒ AddNode
Returns a new instance of AddNode.
21 22 23 |
# File 'lib/ast.rb', line 21 def initialize(left, right) super(left,right) end |
Instance Method Details
#evaluate ⇒ Object
25 26 27 |
# File 'lib/ast.rb', line 25 def evaluate() return @left.evaluate() + @right.evaluate() end |