Class: ActiveWarehouse::Aggregate::Dwarf::DwarfWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_warehouse/aggregate/dwarf/node.rb

Instance Method Summary collapse

Instance Method Details

#write(node) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/active_warehouse/aggregate/dwarf/node.rb', line 16

def write(node)
  n = NodeStruct.new
  n.id = node.id
  n.cells_length = node.cells.length
  
  node.cells.each do |cell|
    c = CellStruct.new
    c.key_len = cell.key.length
    c.key = cell.key
    n.cells << c
  end
  
  ac = CellStruct.new
  ac.key_len = n.all_cell.key.length
  ac.key = n.all_cell.key
  n.all_cell = ac
end