Class: JsonToTable::Table
- Inherits:
-
Object
- Object
- JsonToTable::Table
- Defined in:
- lib/table.rb
Instance Attribute Summary collapse
-
#child_hashes ⇒ Object
readonly
Returns the value of attribute child_hashes.
Instance Method Summary collapse
-
#initialize(object, parent_table = nil) ⇒ Table
constructor
A new instance of Table.
- #terminal_table ⇒ Object
Constructor Details
#initialize(object, parent_table = nil) ⇒ Table
Returns a new instance of Table.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/table.rb', line 7 def initialize(object, parent_table = nil) if object.is_a? Hash @hashes = [object] else @hashes = object end @child_hashes = [] @headings = headings @rows = rows end |
Instance Attribute Details
#child_hashes ⇒ Object (readonly)
Returns the value of attribute child_hashes.
5 6 7 |
# File 'lib/table.rb', line 5 def child_hashes @child_hashes end |
Instance Method Details
#terminal_table ⇒ Object
19 20 21 |
# File 'lib/table.rb', line 19 def terminal_table Terminal::Table.new headings: @headings, rows: @rows end |