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.



45
46
47
# File 'lib/ast.rb', line 45

def initialize(left, right)
  super(left,right)
end

Instance Method Details

#evaluateObject



49
50
51
# File 'lib/ast.rb', line 49

def evaluate 
  @left.evaluate + @right.evaluate
end