Class: AddNode

Inherits:
BinaryNode show all
Defined in:
lib/ast.rb

Instance Attribute Summary

Attributes inherited from BinaryNode

#left, #right

Instance Method Summary collapse

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

#evaluateObject



25
26
27
# File 'lib/ast.rb', line 25

def evaluate() 
  return @left.evaluate() + @right.evaluate()
end