Class: RenderTable::Row
- Inherits:
-
Object
- Object
- RenderTable::Row
- Defined in:
- lib/render_table/row.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#record ⇒ Object
Returns the value of attribute record.
-
#row_index ⇒ Object
Returns the value of attribute row_index.
Class Method Summary collapse
Instance Method Summary collapse
- #cells ⇒ Object
- #class ⇒ Object
- #id ⇒ Object
-
#initialize(record, row_index, table) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(record, row_index, table) ⇒ Row
Returns a new instance of Row.
11 12 13 14 15 16 |
# File 'lib/render_table/row.rb', line 11 def initialize(record, row_index, table) @record = record @row_index = row_index @table = table @html = @table.html[:rows] end |
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
3 4 5 |
# File 'lib/render_table/row.rb', line 3 def html @html end |
#record ⇒ Object
Returns the value of attribute record.
3 4 5 |
# File 'lib/render_table/row.rb', line 3 def record @record end |
#row_index ⇒ Object
Returns the value of attribute row_index.
3 4 5 |
# File 'lib/render_table/row.rb', line 3 def row_index @row_index end |
Class Method Details
.rows_for_table(table) ⇒ Object
5 6 7 8 9 |
# File 'lib/render_table/row.rb', line 5 def self.rows_for_table(table) table.records.collect.with_index do |record, row_index| RenderTable::Row.new(record, row_index, table) end end |
Instance Method Details
#cells ⇒ Object
26 27 28 |
# File 'lib/render_table/row.rb', line 26 def cells RenderTable::Cell.cells_for_row(self, @table) end |
#class ⇒ Object
18 19 20 |
# File 'lib/render_table/row.rb', line 18 def class RenderTable::Html.html_string(@html[:classes], @record, @row_index) end |
#id ⇒ Object
22 23 24 |
# File 'lib/render_table/row.rb', line 22 def id RenderTable::Html.html_string(@html[:ids], @record, @row_index) end |