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.



53
54
55
# File 'lib/trestle/table.rb', line 53

def initialize(table, template)
  @table, @template = table, template
end

Instance Method Details

#classesObject



69
70
71
# File 'lib/trestle/table.rb', line 69

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

#columnsObject



61
62
63
# File 'lib/trestle/table.rb', line 61

def columns
  @columns ||= row.columns
end

#dataObject



73
74
75
# File 'lib/trestle/table.rb', line 73

def data
  options[:data]
end

#idObject



65
66
67
# File 'lib/trestle/table.rb', line 65

def id
  options[:id]
end

#rowObject



57
58
59
# File 'lib/trestle/table.rb', line 57

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