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.



31
32
33
# File 'lib/ast.rb', line 31

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

Instance Method Details

#evaluateObject



35
36
37
# File 'lib/ast.rb', line 35

def evaluate 
  @left.evaluate - @right.evaluate
end