Class: TinyTable::TextFormatter
- Inherits:
-
Object
- Object
- TinyTable::TextFormatter
- Defined in:
- lib/tinytable/text_formatter.rb
Constant Summary collapse
- CORNER =
'+'
- VERTICAL =
'|'
- HORIZONTAL =
'-'
- PADDING =
' '
- STRING_ALIGN =
{ LEFT => :ljust, CENTER => :center, RIGHT => :rjust }
Instance Method Summary collapse
-
#initialize(table) ⇒ TextFormatter
constructor
A new instance of TextFormatter.
- #render ⇒ Object
Constructor Details
#initialize(table) ⇒ TextFormatter
Returns a new instance of TextFormatter.
16 17 18 19 |
# File 'lib/tinytable/text_formatter.rb', line 16 def initialize(table) @table = table @output = '' end |
Instance Method Details
#render ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tinytable/text_formatter.rb', line 21 def render clear_output precompute_table_layout render_header render_rows @output end |