Class: Ea::Cli::Output::TableFormatter
- Defined in:
- lib/ea/cli/output/table_formatter.rb
Constant Summary collapse
- COLUMN_WIDTH =
24- SEPARATOR =
" "
Instance Method Summary collapse
Instance Method Details
#render(rows, columns: []) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/ea/cli/output/table_formatter.rb', line 10 def render(rows, columns: []) return puts("(no rows)") if rows.empty? cols = columns.empty? ? Array(infer_columns(rows)) : columns puts render_header(cols) rows.each { |row| puts render_row(row, cols) } end |