Class: Tilt::HamlTemplate

Inherits:
Template show all
Defined in:
lib/sinatra/tilt.rb

Overview

Haml template implementation. See: haml.hamptoncatlin.com/

Instance Attribute Summary

Attributes inherited from Template

#data, #file, #line, #options

Instance Method Summary collapse

Methods inherited from Template

#basename, #compile, #eval_file, #initialize, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#compile!Object



287
288
289
# File 'lib/sinatra/tilt.rb', line 287

def compile!
  @engine = ::Haml::Engine.new(data, haml_options)
end

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



291
292
293
# File 'lib/sinatra/tilt.rb', line 291

def evaluate(scope, locals, &block)
  @engine.render(scope, locals, &block)
end

#initialize_engineObject



283
284
285
# File 'lib/sinatra/tilt.rb', line 283

def initialize_engine
  require_template_library 'haml' unless defined? ::Haml::Engine
end