Class: Evil::Plugin::TagExecution
- Defined in:
- lib/evil/plugin/block_tag.rb
Instance Method Summary collapse
- #body(locals = {}) ⇒ Object
- #execute ⇒ Object
-
#initialize(tag, options, context, &block) ⇒ TagExecution
constructor
A new instance of TagExecution.
- #to_s ⇒ Object
Constructor Details
#initialize(tag, options, context, &block) ⇒ TagExecution
Returns a new instance of TagExecution.
6 7 8 9 10 11 |
# File 'lib/evil/plugin/block_tag.rb', line 6 def initialize(tag, , context, &block) = Tag.evaluate(, context) @context = context @tag = tag @proc = block end |
Instance Method Details
#body(locals = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/evil/plugin/block_tag.rb', line 13 def body(locals={}) @context.stack do locals.each { |k, v| @context[k.to_s] = v } return @tag.render_body(@context).to_s end end |
#execute ⇒ Object
20 21 22 |
# File 'lib/evil/plugin/block_tag.rb', line 20 def execute self.instance_exec(, &@proc) end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/evil/plugin/block_tag.rb', line 24 def to_s execute.to_s end |