Class: Codgen::HandleBarsTemplateProvider
- Inherits:
-
TemplateProvider
- Object
- TemplateProvider
- Codgen::HandleBarsTemplateProvider
- Defined in:
- lib/codgen/template_provider.rb
Instance Method Summary collapse
Instance Method Details
#extension ⇒ Object
47 48 49 |
# File 'lib/codgen/template_provider.rb', line 47 def extension '.handlebars' end |
#name ⇒ Object
43 44 45 |
# File 'lib/codgen/template_provider.rb', line 43 def name 'handlebars' end |
#render(template, data) ⇒ Object
37 38 39 40 41 |
# File 'lib/codgen/template_provider.rb', line 37 def render(template, data) = Handlebars::Context.new template = .compile(template) template.call(data) end |