Module: Handlebars

Defined in:
lib/handlebars.rb,
lib/handlebars/version.rb

Defined Under Namespace

Classes: CompiledTemplate

Constant Summary collapse

VERSION =
"0.0.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.contextObject (readonly)

Returns the value of attribute context.



14
15
16
# File 'lib/handlebars.rb', line 14

def context
  @context
end

Class Method Details

.compile(*args) ⇒ Object



32
33
34
35
36
# File 'lib/handlebars.rb', line 32

def compile(*args)
  Handlebars.module_eval do
    CompiledTemplate.new(@context, @handlebars.compile(*args))
  end
end

.registerHelper(name, fn) ⇒ Object



40
41
42
43
44
# File 'lib/handlebars.rb', line 40

def registerHelper(name, fn)
  Handlebars.module_eval do
    @handlebars.registerHelper(name, fn)
  end
end