Class: Tilt::Jadeite::JadeTemplate
- Inherits:
-
Template
- Object
- Template
- Tilt::Jadeite::JadeTemplate
- Defined in:
- lib/tilt-jadeite.rb
Instance Method Summary collapse
- #environment ⇒ Object
- #evaluate(scope, locals, &block) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
Instance Method Details
#environment ⇒ Object
17 18 19 |
# File 'lib/tilt-jadeite.rb', line 17 def environment @@environment ||= (@@environment = ::Jadeite::Environment.new(@options)) end |
#evaluate(scope, locals, &block) ⇒ Object
25 26 27 |
# File 'lib/tilt-jadeite.rb', line 25 def evaluate(scope, locals, &block) @compiled.render(locals) end |
#initialize_engine ⇒ Object
12 13 14 15 |
# File 'lib/tilt-jadeite.rb', line 12 def initialize_engine return if defined? ::Jadeite require_template_library 'jadeite' end |
#prepare ⇒ Object
21 22 23 |
# File 'lib/tilt-jadeite.rb', line 21 def prepare @compiled = environment.compile(data, filename: eval_file) end |