Class: TableCreator::Row
- Inherits:
-
Object
- Object
- TableCreator::Row
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/table_creator/row.rb
Instance Attribute Summary collapse
-
#cols ⇒ Object
Returns the value of attribute cols.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(row, parent, options = {}) ⇒ Row
constructor
A new instance of Row.
- #to_csv ⇒ Object
- #to_html ⇒ Object
Constructor Details
Instance Attribute Details
#cols ⇒ Object
Returns the value of attribute cols.
5 6 7 |
# File 'lib/table_creator/row.rb', line 5 def cols @cols end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/table_creator/row.rb', line 5 def @options end |
#parent ⇒ Object
Returns the value of attribute parent.
5 6 7 |
# File 'lib/table_creator/row.rb', line 5 def parent @parent end |
Instance Method Details
#to_csv ⇒ Object
17 18 19 |
# File 'lib/table_creator/row.rb', line 17 def to_csv cols.map(&:to_csv).flatten.join(',') end |
#to_html ⇒ Object
21 22 23 |
# File 'lib/table_creator/row.rb', line 21 def to_html content_tag :tr, cols.map(&:to_html).join.html_safe, .except(:type) end |