Class: HamlCoffeeAssets::HamlCoffeeTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/haml_coffee_assets/haml_coffee_template.rb

Overview

Haml CoffeeScript template implementation for Tilt.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Test if the compiler is initialized.

Returns:

  • (Boolean)

    the initialization status



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_engineObject

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

#prepareObject

Prepare the template



29
30
# File 'lib/haml_coffee_assets/haml_coffee_template.rb', line 29

def prepare
end