Class: TinyTable::Layout

Inherits:
Object
  • Object
show all
Defined in:
lib/tinytable/layout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (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_widthsObject (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

#analyzeObject



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
  analyze_footer

  self
end