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.
47 48 49 |
# File 'lib/trestle/table.rb', line 47 def initialize(table, template) @table, @template = table, template end |
Instance Method Details
#classes ⇒ Object
63 64 65 |
# File 'lib/trestle/table.rb', line 63 def classes ["trestle-table", [:class]].compact end |
#columns ⇒ Object
55 56 57 |
# File 'lib/trestle/table.rb', line 55 def columns @columns ||= row.columns end |
#data ⇒ Object
67 68 69 |
# File 'lib/trestle/table.rb', line 67 def data [:data] end |
#id ⇒ Object
59 60 61 |
# File 'lib/trestle/table.rb', line 59 def id [:id] end |
#row ⇒ Object
51 52 53 |
# File 'lib/trestle/table.rb', line 51 def row @row ||= @table.row.renderer(@template) end |