Class: Journey::Nodes::Binary

Inherits:
Node
  • Object
show all
Defined in:
lib/journey/nodes/node.rb

Direct Known Subclasses

Cat

Instance Attribute Summary collapse

Attributes inherited from Node

#left, #memo

Instance Method Summary collapse

Methods inherited from Node

#each, #literal?, #name, #symbol?, #to_dot, #to_s, #to_sym, #type

Constructor Details

#initialize(left, right) ⇒ Binary

Returns a new instance of Binary.



100
101
102
103
# File 'lib/journey/nodes/node.rb', line 100

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

Instance Attribute Details

#rightObject

Returns the value of attribute right.



98
99
100
# File 'lib/journey/nodes/node.rb', line 98

def right
  @right
end

Instance Method Details

#childrenObject



105
# File 'lib/journey/nodes/node.rb', line 105

def children; [left, right] end