Class: Volt::YieldBinding
- Inherits:
-
BaseBinding
- Object
- BaseBinding
- Volt::YieldBinding
- Defined in:
- lib/volt/page/bindings/yield_binding.rb
Instance Attribute Summary
Attributes inherited from BaseBinding
#binding_name, #context, #target
Instance Method Summary collapse
-
#initialize(page, target, context, binding_name) ⇒ YieldBinding
constructor
A new instance of YieldBinding.
- #remove ⇒ Object
Methods inherited from BaseBinding
Constructor Details
#initialize(page, target, context, binding_name) ⇒ YieldBinding
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/volt/page/bindings/yield_binding.rb', line 8 def initialize(page, target, context, binding_name) super(page, target, context, binding_name) # Get the path to the template to yield full_path = @context.attrs.content_template_path # Grab the controller for the content controller = @context.attrs.content_controller @current_template = TemplateRenderer.new(@page, @target, controller, @binding_name, full_path) end |
Instance Method Details
#remove ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/volt/page/bindings/yield_binding.rb', line 20 def remove if @current_template # Remove the template if one has been rendered, when the template binding is # removed. @current_template.remove end super end |