Class: Trestle::Table::Renderer
- Inherits:
-
Object
- Object
- Trestle::Table::Renderer
- Defined in:
- lib/trestle/table.rb
Instance Method Summary collapse
- #classes ⇒ Object
- #columns ⇒ Object
- #data ⇒ Object
- #id ⇒ Object
-
#initialize(table, template) ⇒ Renderer
constructor
A new instance of Renderer.
- #row ⇒ Object
Constructor Details
#initialize(table, template) ⇒ Renderer
Returns a new instance of Renderer.
53 54 55 |
# File 'lib/trestle/table.rb', line 53 def initialize(table, template) @table, @template = table, template end |
Instance Method Details
#classes ⇒ Object
69 70 71 |
# File 'lib/trestle/table.rb', line 69 def classes ["trestle-table", [:class]].compact end |
#columns ⇒ Object
61 62 63 |
# File 'lib/trestle/table.rb', line 61 def columns @columns ||= row.columns end |
#data ⇒ Object
73 74 75 |
# File 'lib/trestle/table.rb', line 73 def data [:data] end |
#id ⇒ Object
65 66 67 |
# File 'lib/trestle/table.rb', line 65 def id [:id] end |
#row ⇒ Object
57 58 59 |
# File 'lib/trestle/table.rb', line 57 def row @row ||= @table.row.renderer(@template) end |