Class: Binary_tree::Node
- Inherits:
-
Object
- Object
- Binary_tree::Node
- Defined in:
- lib/models/binary_tree/binary_tree.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#left ⇒ Object
Returns the value of attribute left.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#right ⇒ Object
Returns the value of attribute right.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, color = RED) ⇒ Node
constructor
A new instance of Node.
Constructor Details
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
10 11 12 |
# File 'lib/models/binary_tree/binary_tree.rb', line 10 def color @color end |
#left ⇒ Object
Returns the value of attribute left.
10 11 12 |
# File 'lib/models/binary_tree/binary_tree.rb', line 10 def left @left end |
#parent ⇒ Object
Returns the value of attribute parent.
10 11 12 |
# File 'lib/models/binary_tree/binary_tree.rb', line 10 def parent @parent end |
#right ⇒ Object
Returns the value of attribute right.
10 11 12 |
# File 'lib/models/binary_tree/binary_tree.rb', line 10 def right @right end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/models/binary_tree/binary_tree.rb', line 10 def value @value end |