Class: Trestle::Table::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/trestle/table.rb

Instance Method Summary collapse

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

#classesObject



63
64
65
# File 'lib/trestle/table.rb', line 63

def classes
  ["trestle-table", options[:class]].compact
end

#columnsObject



55
56
57
# File 'lib/trestle/table.rb', line 55

def columns
  @columns ||= row.columns
end

#dataObject



67
68
69
# File 'lib/trestle/table.rb', line 67

def data
  options[:data]
end

#idObject



59
60
61
# File 'lib/trestle/table.rb', line 59

def id
  options[:id]
end

#rowObject



51
52
53
# File 'lib/trestle/table.rb', line 51

def row
  @row ||= @table.row.renderer(@template)
end