Class: RablTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/rabl/template.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(context_scope, locals, &block) ⇒ Object



13
14
15
16
# File 'lib/rabl/template.rb', line 13

def evaluate(context_scope, locals, &block)
  options = @options.merge(:source_location => file)
  ::Rabl::Engine.new(data, options).apply(context_scope, locals, &block).render
end

#initialize_engineObject



4
5
6
7
# File 'lib/rabl/template.rb', line 4

def initialize_engine
  return if defined?(::Rabl)
  require_template_library 'rabl'
end

#prepareObject



9
10
11
# File 'lib/rabl/template.rb', line 9

def prepare
  #left empty so each invocation has a new hash of options and new rabl engine for thread safety
end