Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/binary-tree-node.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#east ⇒ Object
Returns the value of attribute east.
-
#west ⇒ Object
Returns the value of attribute west.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
Instance Method Summary collapse
-
#initialize(x, *args) ⇒ Node
constructor
Create the tree’s root with the base value x and an unkown number of arguments.
Constructor Details
#initialize(x, *args) ⇒ Node
Create the tree’s root with the base value x and an unkown number of arguments.
7 8 9 10 |
# File 'lib/binary-tree-node.rb', line 7 def initialize(x, *args) @x = x @args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
3 4 5 |
# File 'lib/binary-tree-node.rb', line 3 def args @args end |
#east ⇒ Object
Returns the value of attribute east.
3 4 5 |
# File 'lib/binary-tree-node.rb', line 3 def east @east end |
#west ⇒ Object
Returns the value of attribute west.
3 4 5 |
# File 'lib/binary-tree-node.rb', line 3 def west @west end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
2 3 4 |
# File 'lib/binary-tree-node.rb', line 2 def x @x end |