Class: HammerCLI::Output::Generators::Table
- Inherits:
-
Object
- Object
- HammerCLI::Output::Generators::Table
- Defined in:
- lib/hammer_cli/output/generators/table.rb
Defined Under Namespace
Classes: Column
Constant Summary collapse
- MAX_COLUMN_WIDTH =
80- MIN_COLUMN_WIDTH =
5- HLINE =
'-'- LINE_SEPARATOR =
'-|-'- COLUMN_SEPARATOR =
' | '
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#footer ⇒ Object
readonly
Returns the value of attribute footer.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(columns, data, options = {}) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(columns, data, options = {}) ⇒ Table
Returns a new instance of Table.
25 26 27 28 29 30 |
# File 'lib/hammer_cli/output/generators/table.rb', line 25 def initialize(columns, data, = {}) @columns = columns.map { |label, params| Column.new(label, params) } @data = data = create_table end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
23 24 25 |
# File 'lib/hammer_cli/output/generators/table.rb', line 23 def body @body end |
#footer ⇒ Object (readonly)
Returns the value of attribute footer.
23 24 25 |
# File 'lib/hammer_cli/output/generators/table.rb', line 23 def end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
23 24 25 |
# File 'lib/hammer_cli/output/generators/table.rb', line 23 def header @header end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
23 24 25 |
# File 'lib/hammer_cli/output/generators/table.rb', line 23 def result @result end |