Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/tree_handler/node.rb
Instance Attribute Summary collapse
-
#left_child ⇒ Object
Returns the value of attribute left_child.
-
#right_child ⇒ Object
Returns the value of attribute right_child.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Node
constructor
A new instance of Node.
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_child ⇒ Object
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_child ⇒ Object
Returns the value of attribute right_child.
2 3 4 |
# File 'lib/tree_handler/node.rb', line 2 def right_child @right_child end |
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'lib/tree_handler/node.rb', line 2 def value @value end |