Method: ObjectTable::Printing.format_section

Defined in:
lib/object_table/printing.rb

.format_section(columns, row_slice) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/object_table/printing.rb', line 55

def self.format_section(columns, row_slice)
  row_slice = row_slice.to_a
  numbers = split_column_lines('', row_slice.map{|i| "#{i}: "})

  section = columns.map do |name, c|
    c = (row_slice.empty? ? NArray[] : c.slice(false, row_slice))
    c = format_column(c)
    c = split_column_lines(name.to_s, c)
  end

  [numbers] + section
end