Class: JCF::CLI::OutputFormatters::Text
- Inherits:
-
Object
- Object
- JCF::CLI::OutputFormatters::Text
- Defined in:
- lib/jcf/cli/output_formatters/text.rb
Class Method Summary collapse
-
.format(data:, tree: false) ⇒ String
data: { header1: %w[name1 name2], header2: %w[space1 space2]} output: ┌────────┬────────┐ │header1 │header2 │ ├────────┼────────┤ │name1 │space1 │ │name2 │space2 │ └────────┴────────┘.
Class Method Details
.format(data:, tree: false) ⇒ String
data: { header1: %w[name1 name2], header2: %w[space1 space2]} output: ┌────────┬────────┐ │header1 │header2 │ ├────────┼────────┤ │name1 │space1 │ │name2 │space2 │ └────────┴────────┘
23 24 25 26 27 28 29 30 31 |
# File 'lib/jcf/cli/output_formatters/text.rb', line 23 def format(data:, tree: false) return "" if data.nil? || data.empty? if tree render_tree(data) else render_data(data) end end |