Class: HamlCoffee::TiltTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/haml_coffee/tilt_template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_mime_typeObject



19
20
21
# File 'lib/haml_coffee/tilt_template.rb', line 19

def self.default_mime_type
  'application/javascript'
end

Instance Method Details

#evaluate(scope, locals = {}, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/haml_coffee/tilt_template.rb', line 25

def evaluate(scope, locals = {}, &block)
  filename = if scope.respond_to?(:logical_path) # Sprockets
               scope.logical_path
             elsif scope.respond_to?(:filename)
               scope.filename
             elsif locals.key?(:filename)
               locals[:filename]
             end

  HamlCoffee.compile(data, :filename => filename)
end

#prepareObject



23
# File 'lib/haml_coffee/tilt_template.rb', line 23

def prepare ; end