Class: HamlCoffeeAssets::HamlCoffeeTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- HamlCoffeeAssets::HamlCoffeeTemplate
- Defined in:
- lib/haml_coffee_assets/haml_coffee_template.rb
Overview
Haml CoffeeScript template implementation for Tilt.
Class Method Summary collapse
-
.engine_initialized? ⇒ Boolean
Test if the compiler is initialized.
Instance Method Summary collapse
-
#evaluate(scope, locals = { }, &block) ⇒ Object
Compile the template.
-
#initialize_engine ⇒ Object
Initialize the template engine.
-
#prepare ⇒ Object
Prepare the template.
Class Method Details
.engine_initialized? ⇒ Boolean
Test if the compiler is initialized.
17 18 19 |
# File 'lib/haml_coffee_assets/haml_coffee_template.rb', line 17 def self.engine_initialized? defined? HamlCoffee end |
Instance Method Details
#evaluate(scope, locals = { }, &block) ⇒ Object
Compile the template.
34 35 36 |
# File 'lib/haml_coffee_assets/haml_coffee_template.rb', line 34 def evaluate(scope, locals = { }, &block) @output ||= HamlCoffee.compile(scope.logical_path, data) end |
#initialize_engine ⇒ Object
Initialize the template engine.
23 24 25 |
# File 'lib/haml_coffee_assets/haml_coffee_template.rb', line 23 def initialize_engine require_template_library 'haml_coffee' end |
#prepare ⇒ Object
Prepare the template
29 30 |
# File 'lib/haml_coffee_assets/haml_coffee_template.rb', line 29 def prepare end |