Class: Tilt::Jadeite::JadeTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/tilt-jadeite.rb

Instance Method Summary collapse

Instance Method Details

#environmentObject



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_engineObject



12
13
14
15
# File 'lib/tilt-jadeite.rb', line 12

def initialize_engine
  return if defined? ::Jadeite
  require_template_library 'jadeite'
end

#prepareObject



21
22
23
# File 'lib/tilt-jadeite.rb', line 21

def prepare
  @compiled = environment.compile(data, filename: eval_file)
end