Module: Legion::TTY::Components::TableView
- Defined in:
- lib/legion/tty/components/table_view.rb
Class Method Summary collapse
Class Method Details
.render(headers:, rows:, width: 80) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/legion/tty/components/table_view.rb', line 7 def self.render(headers:, rows:, width: 80) require 'tty-table' table = ::TTY::Table.new(header: headers, rows: rows) table.render(:unicode, width: width, padding: [0, 1]) || '' rescue StandardError => e "Table render error: #{e.}" end |