Class: HtmlFormatter
- Inherits:
-
Object
- Object
- HtmlFormatter
- Defined in:
- lib/tablesmith/html_formatter.rb
Instance Attribute Summary collapse
-
#indent ⇒ Object
readonly
Returns the value of attribute indent.
Instance Method Summary collapse
-
#initialize(table) ⇒ HtmlFormatter
constructor
A new instance of HtmlFormatter.
- #to_html ⇒ Object
Constructor Details
#initialize(table) ⇒ HtmlFormatter
Returns a new instance of HtmlFormatter.
6 7 8 9 |
# File 'lib/tablesmith/html_formatter.rb', line 6 def initialize(table) @table = table @indent = ' ' end |
Instance Attribute Details
#indent ⇒ Object (readonly)
Returns the value of attribute indent.
4 5 6 |
# File 'lib/tablesmith/html_formatter.rb', line 4 def indent @indent end |
Instance Method Details
#to_html ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/tablesmith/html_formatter.rb', line 11 def to_html @lines = [] @lines << '<table>' append_table_head append_table_body @lines << '</table>' @lines.join("\n") + "\n" end |