Class: Midge::JstProcessor
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Midge::JstProcessor
- Includes:
- Util
- Defined in:
- lib/midge/template.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.default_mime_type ⇒ Object
7 8 9 |
# File 'lib/midge/template.rb', line 7 def self.default_mime_type 'application/javascript' end |
.engine_initialized? ⇒ Boolean
11 12 13 |
# File 'lib/midge/template.rb', line 11 def self.engine_initialized? true end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/midge/template.rb', line 18 def evaluate(scope, locals, &block) "(function() {\n (this.\#{global_name} || (this.\#{global_name} = {})).JST || (this.\#{global_name}.JST = {});\n this.\#{global_name}.JST[\#{scope.logical_path.inspect}] = \#{indent(data)};\n}).call(this);\n JST\nend\n" |
#prepare ⇒ Object
15 16 |
# File 'lib/midge/template.rb', line 15 def prepare end |