Class: RowOfNodes
- Inherits:
-
Object
- Object
- RowOfNodes
- Defined in:
- lib/generic/row_of_nodes.rb
Instance Method Summary collapse
-
#initialize(tree) ⇒ RowOfNodes
constructor
A new instance of RowOfNodes.
- #row_of_nodes ⇒ Object
Constructor Details
#initialize(tree) ⇒ RowOfNodes
Returns a new instance of RowOfNodes.
9 10 11 12 |
# File 'lib/generic/row_of_nodes.rb', line 9 def initialize(tree) @tree = tree @array = Array.new(tree.values.size, [0,0]) end |
Instance Method Details
#row_of_nodes ⇒ Object
14 15 16 17 18 |
# File 'lib/generic/row_of_nodes.rb', line 14 def row_of_nodes n = @tree.root_id set_row_of_nodes(n) @array.map { |xx| xx[0] } end |