Class: TimesNode
- Inherits:
-
BinaryNode
- Object
- BinaryNode
- TimesNode
- Defined in:
- lib/ast.rb
Instance Attribute Summary
Attributes inherited from BinaryNode
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(left, right) ⇒ TimesNode
constructor
A new instance of TimesNode.
Constructor Details
#initialize(left, right) ⇒ TimesNode
Returns a new instance of TimesNode.
43 44 45 |
# File 'lib/ast.rb', line 43 def initialize(left, right) super(left, right) end |
Instance Method Details
#evaluate ⇒ Object
47 48 49 |
# File 'lib/ast.rb', line 47 def evaluate() return @left.evaluate() * @right.evaluate() end |