Class: SubNode

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) ⇒ 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

#evaluateObject



37
38
39
# File 'lib/ast.rb', line 37

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