Class: RablTemplate

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

Instance Method Summary collapse

Instance Method Details

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



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

def evaluate(scope, locals, &block)
  @engine.render(scope, locals, &block)
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
12
# File 'lib/rabl/template.rb', line 9

def prepare
  options = @options.merge(:format => @options[:format], :source_location => file)
  @engine = ::Rabl::Engine.new(data, options)
end