Class: TablePrint::FixedWidthFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/table_print-patch-pr70/formatter.rb

Instance Method Summary collapse

Instance Method Details

#format(value) ⇒ Object



6
7
8
9
# File 'lib/table_print-patch-pr70/formatter.rb', line 6

def format(value)
  padding = width - length(escape_strip(value).to_s)
  truncate(value) + (padding < 0 ? '' : " " * padding)
end