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.



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

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



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

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



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

def right
  @right
end