Class: Text::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/rs_api/patches/text_table__cell_patch.rb,
lib/rs_api/patches/text_table__table_patch.rb

Defined Under Namespace

Classes: Cell

Instance Method Summary collapse

Instance Method Details

#column_widthsObject



7
8
9
10
11
12
# File 'lib/rs_api/patches/text_table__table_patch.rb', line 7

def column_widths
  @column_widths ||= \
  all_text_table_rows.reject {|row| row.cells == :separator}.map do |row|
    row.cells.map {|cell| [(cell.width/cell.colspan.to_f).ceil] * cell.colspan}.flatten
  end.transpose.map(&:max)
end