Class: Linner::Wrapper::Template
- Inherits:
-
Object
- Object
- Linner::Wrapper::Template
- Defined in:
- lib/linner/wrapper.rb
Class Method Summary collapse
Class Method Details
.definition(content) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/linner/wrapper.rb', line 29 def self.definition(content) "(function() {\n var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};\n \#{content}\n})();\n" end |
.partial_wrap(name, content) ⇒ Object
22 23 24 25 26 |
# File 'lib/linner/wrapper.rb', line 22 def self.partial_wrap(name, content) "Handlebars.registerPartial(\"\#{name}\", Handlebars.template(\#{content}));\n" end |
.wrap(name, content) ⇒ Object
16 17 18 19 20 |
# File 'lib/linner/wrapper.rb', line 16 def self.wrap(name, content) "templates[\"\#{name}\"] = template(\#{content});\n" end |