Class: Handlebars::Template
- Inherits:
-
Object
- Object
- Handlebars::Template
- Defined in:
- lib/ruby-handlebars/template.rb
Instance Method Summary collapse
- #call(args = nil) ⇒ Object
-
#initialize(hbs, ast) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(hbs, ast) ⇒ Template
Returns a new instance of Template.
5 6 7 8 |
# File 'lib/ruby-handlebars/template.rb', line 5 def initialize(hbs, ast) @hbs = hbs @ast = ast end |
Instance Method Details
#call(args = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/ruby-handlebars/template.rb', line 10 def call(args = nil) if args @hbs.set_context(args) end @ast.eval(@hbs) end |