Class: DartTrails::Tilt::Template
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- DartTrails::Tilt::Template
- Defined in:
- lib/dart_trails/tilt/template.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
Class Method Summary collapse
Instance Method Summary collapse
-
#evaluate(scope, locals, &block) ⇒ Object
Several attributes are available.
-
#initialize_engine ⇒ Object
Called once, the first time the class is initialized.
-
#prepare ⇒ Object
Implementation of #prepare is required by Tilt::Template and is called before #evaluate.
Instance Attribute Details
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
5 6 7 |
# File 'lib/dart_trails/tilt/template.rb', line 5 def engine @engine end |
Class Method Details
.default_mime_type ⇒ Object
14 15 16 |
# File 'lib/dart_trails/tilt/template.rb', line 14 def self.default_mime_type 'application/javascript' end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
Several attributes are available.
#file -> The name/path given for the original file.
If a block passed to #new in place of a file, this will
return nil.
#data -> The data read from the file or passed in directly through
a block.
... (see the source code) ...
34 35 36 |
# File 'lib/dart_trails/tilt/template.rb', line 34 def evaluate(scope, locals, &block) engine.compile end |
#initialize_engine ⇒ Object
Called once, the first time the class is initialized. Use this to require the underlying template library and perform any initial setup.
11 12 |
# File 'lib/dart_trails/tilt/template.rb', line 11 def initialize_engine end |