Class: Tilt::StylusTemplate
- Inherits:
-
Template
- Object
- Template
- Tilt::StylusTemplate
- Defined in:
- lib/stylus/tilt.rb
Overview
stylus template implementation for ‘Tilt`.
It can be used by the ‘Rails` 3.1 or `Sinatra` applications.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.engine_initialized? ⇒ Boolean
10 11 12 |
# File 'lib/stylus/tilt.rb', line 10 def self.engine_initialized? defined? ::Stylus end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
24 25 26 |
# File 'lib/stylus/tilt.rb', line 24 def evaluate(scope, locals, &block) @output ||= Stylus.compile(data, ) end |
#initialize_engine ⇒ Object
14 15 16 |
# File 'lib/stylus/tilt.rb', line 14 def initialize_engine require_template_library 'stylus' end |
#prepare ⇒ Object
18 19 20 21 22 |
# File 'lib/stylus/tilt.rb', line 18 def prepare if self.file [:filename] ||= self.file end end |