Class: Tabloid::HeaderRow
- Inherits:
-
Object
- Object
- Tabloid::HeaderRow
- Defined in:
- lib/tabloid/header_row.rb
Instance Method Summary collapse
-
#initialize(text, options = {}) ⇒ HeaderRow
constructor
A new instance of HeaderRow.
- #summarize ⇒ Object
- #to_a ⇒ Object
- #to_csv ⇒ Object
- #to_html(options = {}) ⇒ Object
Constructor Details
#initialize(text, options = {}) ⇒ HeaderRow
Returns a new instance of HeaderRow.
2 3 4 5 |
# File 'lib/tabloid/header_row.rb', line 2 def initialize(text, ={}) @text = text @options = end |
Instance Method Details
#summarize ⇒ Object
22 23 24 |
# File 'lib/tabloid/header_row.rb', line 22 def summarize nil end |
#to_a ⇒ Object
18 19 20 |
# File 'lib/tabloid/header_row.rb', line 18 def to_a [@text].fill(nil, 1, column_count-1) end |
#to_csv ⇒ Object
7 8 9 |
# File 'lib/tabloid/header_row.rb', line 7 def to_csv FasterCSV.generate{|csv| csv << to_a} end |
#to_html(options = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/tabloid/header_row.rb', line 11 def to_html(={}) html = Builder::XmlMarkup.new html.tr("class" => ([:class] || "header")) do |tr| tr.td(@text, "colspan" => column_count) end end |