Class: BinaryNode

Inherits:
Object
  • Object
show all
Defined in:
lib/ast.rb

Direct Known Subclasses

AddNode, DivideNode, SubNode, TimesNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ BinaryNode

Returns a new instance of BinaryNode.



7
8
9
10
# File 'lib/ast.rb', line 7

def initialize(left,right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



5
6
7
# File 'lib/ast.rb', line 5

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



5
6
7
# File 'lib/ast.rb', line 5

def right
  @right
end