Class: RowOfNodes

Inherits:
Object
  • Object
show all
Defined in:
lib/generic/row_of_nodes.rb

Instance Method Summary collapse

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_nodesObject



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