Method: DomTemplate#initialize
- Defined in:
- lib/volt/page/targets/dom_template.rb
#initialize(page, template_name) ⇒ DomTemplate
Returns a new instance of DomTemplate.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/volt/page/targets/dom_template.rb', line 11 def initialize(page, template_name) template = page.templates[template_name] if template html = template['html'] @bindings = template['bindings'] else html = "<div>-- < missing template #{template_name.inspect.gsub('<', '<').gsub('>', '>')} > --</div>" @bindings = {} end @nodes = build_from_html(html) track_binding_anchors end |