Sha256: c12825d98dab7cda42681205c732764ace5b8d0ce35a0bf34daa02b2c5466968

Contents?: true

Size: 317 Bytes

Versions: 12

Compression:

Stored size: 317 Bytes

Contents

module Handlebars
  class Template
    def initialize(context, fn)
      @context, @fn = context, fn
    end
    
    def call(*args)
      current = Handlebars::Context.current
      Handlebars::Context.current = @context
      @fn.call(*args)
    ensure
      Handlebars::Context.current = current
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
handlebars-0.8.0 lib/handlebars/template.rb
handlebars-0.7.0 lib/handlebars/template.rb
handlebars-0.6.0 lib/handlebars/template.rb
handlebars-0.5.0 lib/handlebars/template.rb
handlebars-0.4.0 lib/handlebars/template.rb
handlebars-0.3.2 lib/handlebars/template.rb
handlebars-0.3.2beta4 lib/handlebars/template.rb
handlebars-0.3.2beta3 lib/handlebars/template.rb
handlebars-0.3.2beta2 lib/handlebars/template.rb
handlebars-0.3.2beta1 lib/handlebars/template.rb
handlebars-0.3.1 lib/handlebars/template.rb
handlebars-0.3.0 lib/handlebars/template.rb