Class: Volt::TemplateRenderer
- Inherits:
-
BaseBinding
- Object
- BaseBinding
- Volt::TemplateRenderer
- Defined in:
- lib/volt/page/template_renderer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Attributes inherited from BaseBinding
#binding_name, #target, #volt_app
Instance Method Summary collapse
-
#initialize(volt_app, target, context, binding_name, template_name) ⇒ TemplateRenderer
constructor
A new instance of TemplateRenderer.
- #remove ⇒ Object
Methods inherited from BaseBinding
#browser, #dom_section, #getter_fail, #remove_anchors
Constructor Details
#initialize(volt_app, target, context, binding_name, template_name) ⇒ TemplateRenderer
Returns a new instance of TemplateRenderer.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/volt/page/template_renderer.rb', line 7 def initialize(volt_app, target, context, binding_name, template_name) super(volt_app, target, context, binding_name) @sub_bindings = [] bindings = dom_section.set_content_to_template(volt_app, template_name) bindings.each_pair do |id, bindings_for_id| bindings_for_id.each do |binding| @sub_bindings << binding.call(volt_app, target, context, id) end end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/volt/page/template_renderer.rb', line 5 def context @context end |
Instance Method Details
#remove ⇒ Object
21 22 23 24 25 26 |
# File 'lib/volt/page/template_renderer.rb', line 21 def remove @sub_bindings.each(&:remove) @sub_bindings = [] super end |