Class: Gemat::OrgFormatter
Instance Method Summary collapse
-
#gen_rows ⇒ Object
rubocop:disable Metrics/AbcSize.
Methods inherited from Formatter
Constructor Details
This class inherits a constructor from Gemat::Formatter
Instance Method Details
#gen_rows ⇒ Object
rubocop:disable Metrics/AbcSize
8 9 10 11 12 13 14 |
# File 'lib/org_formatter.rb', line 8 def gen_rows @rows << "| #{@columns.map { |column| column.column_name.ljust(column.max_length) }.join(' | ')} |" @rows << "|#{@columns.map { |column| '-' * (column.max_length + 2) }.join('+')}|" @gems.each do |gem| @rows << "| #{@columns.map { |column| column.call(gem).to_s.ljust(column.max_length) }.join(' | ')} |" end end |