Class: DivideNode
- Inherits:
-
BinaryNode
- Object
- BinaryNode
- DivideNode
- Defined in:
- lib/ast.rb
Instance Attribute Summary
Attributes inherited from BinaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(left, right) ⇒ DivideNode
constructor
A new instance of DivideNode.
Constructor Details
#initialize(left, right) ⇒ DivideNode
Returns a new instance of DivideNode.
60 61 62 |
# File 'lib/ast.rb', line 60 def initialize(left, right) super(left,right) end |
Instance Method Details
#evaluate ⇒ Object
63 64 65 |
# File 'lib/ast.rb', line 63 def evaluate() @left.evaluate() / @right.evaluate() end |