Class: Terminal::Table::Separator

Inherits:
Row
  • Object
show all
Defined in:
lib/terminal-table/separator.rb

Instance Attribute Summary

Attributes inherited from Row

#cells, #table

Instance Method Summary collapse

Methods inherited from Row

#[], #add_cell, #height, #initialize, #number_of_columns

Constructor Details

This class inherits a constructor from Terminal::Table::Row

Instance Method Details

#renderObject



5
6
7
8
9
10
11
# File 'lib/terminal-table/separator.rb', line 5

def render
  arr_x = (0...@table.number_of_columns).to_a.map do |i|
    @table.style.border_x * (@table.column_width(i) + @table.cell_padding)
  end
  border_i = @table.style.border_i
  border_i + arr_x.join(border_i) + border_i
end