Class: Tabled::Template::Row

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

Class Method Summary collapse

Class Method Details

.render(row, columns_width, _is_framed) ⇒ Object

| Luke Skywalker 172 male |



7
8
9
10
11
12
# File 'lib/template.rb', line 7

def self.render(row, columns_width, _is_framed)
  row[0..-2].map.with_index do |column, index|
    spaces = ' ' * (columns_width[index] - column.to_s.gsub(/\e\[[0-9;]*m/, '').size)
    column.to_s + spaces
  end.join
end