Class: Malt::Engine::Sass

Inherits:
Abstract show all
Defined in:
lib/malt/engines/sass.rb

Overview

Sass Malt Engine

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, default, #initialize, #prepare_engine, register, type

Constructor Details

This class inherits a constructor from Malt::Engine::Abstract

Instance Method Details

#create_engine(params = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/malt/engines/sass.rb', line 25

def create_engine(params={})
  text, file, type = parameters(params, :text, :file, :type)

  opts = engine_options(params)

  opts[:filename] = file
  opts[:syntax]   = type

  cached(text, file, type) do
    ::Sass::Engine.new(text, opts)
  end
end

#render(params = {}, &content) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/malt/engines/sass.rb', line 12

def render(params={}, &content)
  into = parameters(params, :to)

  case into
  when :css, nil
    engine = prepare_engine(params)
    engine.render
  else
    super(params, &content)
  end
end