Class: TinyTable::Layout
- Inherits:
-
Object
- Object
- TinyTable::Layout
- Defined in:
- lib/tinytable/layout.rb
Instance Attribute Summary collapse
-
#column_count ⇒ Object
readonly
Returns the value of attribute column_count.
-
#max_column_widths ⇒ Object
readonly
Returns the value of attribute max_column_widths.
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(table) ⇒ Layout
constructor
A new instance of Layout.
Constructor Details
#initialize(table) ⇒ Layout
Returns a new instance of Layout.
5 6 7 |
# File 'lib/tinytable/layout.rb', line 5 def initialize(table) @table = table end |
Instance Attribute Details
#column_count ⇒ Object (readonly)
Returns the value of attribute column_count.
3 4 5 |
# File 'lib/tinytable/layout.rb', line 3 def column_count @column_count end |
#max_column_widths ⇒ Object (readonly)
Returns the value of attribute max_column_widths.
3 4 5 |
# File 'lib/tinytable/layout.rb', line 3 def max_column_widths @max_column_widths end |
Instance Method Details
#analyze ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tinytable/layout.rb', line 9 def analyze @column_count = 0 @max_column_widths = [] analyze_header analyze_rows self end |