Class: Trestle::Table::Row::Renderer

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

Instance Method Summary collapse

Constructor Details

#initialize(row, template) ⇒ Renderer

Returns a new instance of Renderer.



18
19
20
# File 'lib/trestle/table/row.rb', line 18

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

Instance Method Details

#options(instance) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/trestle/table/row.rb', line 22

def options(instance)
  options = Trestle::Options.new
  options.merge!(data: { url: admin_url_for(instance) }) if table.options[:admin]
  options.merge!(@row.options)
  options.merge!(@template.instance_exec(instance, &@row.block)) if @row.block
  options
end