Class: Tilt::SassTemplate

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

Overview

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

Sass templates do not support object scopes, locals, or yield.

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



312
313
314
# File 'lib/sinatra/tilt.rb', line 312

def compile!
  @engine = ::Sass::Engine.new(data, sass_options)
end

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



316
317
318
# File 'lib/sinatra/tilt.rb', line 316

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

#initialize_engineObject



308
309
310
# File 'lib/sinatra/tilt.rb', line 308

def initialize_engine
  require_template_library 'sass' unless defined? ::Sass::Engine
end