Class: SubNode
- Inherits:
-
BinaryNode
- Object
- BinaryNode
- SubNode
- Defined in:
- lib/ast.rb
Instance Attribute Summary
Attributes inherited from BinaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(left, right) ⇒ SubNode
constructor
A new instance of SubNode.
Constructor Details
#initialize(left, right) ⇒ SubNode
Returns a new instance of SubNode.
33 34 35 |
# File 'lib/ast.rb', line 33 def initialize(left, right) super(left,right) end |
Instance Method Details
#evaluate ⇒ Object
37 38 39 |
# File 'lib/ast.rb', line 37 def evaluate() return @left.evaluate() - @right.evaluate() end |