Class: Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Node

Returns a new instance of Node.



4
5
6
7
8
# File 'lib/tree_handler/node.rb', line 4

def initialize(value)
  @value = value
  @left_child = nil
  @right_child = nil
end

Instance Attribute Details

#left_childObject

Returns the value of attribute left_child.



2
3
4
# File 'lib/tree_handler/node.rb', line 2

def left_child
  @left_child
end

#right_childObject

Returns the value of attribute right_child.



2
3
4
# File 'lib/tree_handler/node.rb', line 2

def right_child
  @right_child
end

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/tree_handler/node.rb', line 2

def value
  @value
end