Class: Jet::HandlebarsTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Jet::HandlebarsTemplate
- Defined in:
- lib/jet/handlebars_template.rb
Constant Summary collapse
- JS_ESCAPE_MAP =
{ '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" }
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.default_mime_type ⇒ Object
7 8 9 |
# File 'lib/jet/handlebars_template.rb', line 7 def self.default_mime_type 'application/javascript' end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
11 12 13 |
# File 'lib/jet/handlebars_template.rb', line 11 def evaluate(scope, locals, &block) "SC.Handlebars.compile(\"#{escaped_data}\")" end |
#prepare ⇒ Object
15 16 |
# File 'lib/jet/handlebars_template.rb', line 15 def prepare end |