Class: Tabled::Template::RowFooter

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

Class Method Summary collapse

Class Method Details

.render(row, columns_width, _is_framed) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/template.rb', line 28

def self.render(row, columns_width, _is_framed)
  return nil unless row.last.fetch(:footer, false)

  footer = row.last.fetch(:footer)
  required_spaces = columns_width.sum - footer.gsub(/\e\[[0-9;]*m/, '').size
  footer + (' ' * required_spaces)
end