class Trestle::Toolbar::Block
Wraps a toolbar block to provide evaluation within the context of a template and enumerator
Public Class Methods
new(&block)
click to toggle source
# File lib/trestle/toolbar.rb, line 36 def initialize(&block) @block = block end
Public Instance Methods
evaluate(builder, template, enumerator, *args)
click to toggle source
# File lib/trestle/toolbar.rb, line 40 def evaluate(builder, template, enumerator, *args) context = Context.new(builder, enumerator, *args) result = template.capture { template.instance_exec(context, *args, &@block) } enumerator << [result] if result.present? end