Sha256: ac1e971350fe23ff09a4beec9d4a84c93338ec917d752f1ecd72a02acb63f9ef

Contents?: true

Size: 537 Bytes

Versions: 12

Compression:

Stored size: 537 Bytes

Contents

class ReactiveTemplate
  include Events

  def initialize(page, context, template_path)
    @template_path = template_path
    @target = AttributeTarget.new(nil, nil, self)
    @template = TemplateRenderer.new(page, @target, context, "main", template_path)

  end

  def reactive?
    true
  end

  # Render the template and get the current value
  def cur
    @target.to_html
  end

  def update
    trigger!('changed')
  end

  def remove
    @template.remove

    @template = nil
    @target = nil
    @template_path = nil
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
volt-0.7.23 lib/volt/page/reactive_template.rb
volt-0.7.22 lib/volt/page/reactive_template.rb
volt-0.7.21 lib/volt/page/reactive_template.rb
volt-0.7.20 lib/volt/page/reactive_template.rb
volt-0.7.19 lib/volt/page/reactive_template.rb
volt-0.7.18 lib/volt/page/reactive_template.rb
volt-0.7.17 lib/volt/page/reactive_template.rb
volt-0.7.16 lib/volt/page/reactive_template.rb
volt-0.7.15 lib/volt/page/reactive_template.rb
volt-0.7.14 lib/volt/page/reactive_template.rb
volt-0.7.13 lib/volt/page/reactive_template.rb
volt-0.7.12 lib/volt/page/reactive_template.rb