Class: Malt::Engines::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?, #compile, default, #initialize, register

Constructor Details

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

Instance Method Details

#intermediate(params) ⇒ Object



27
28
29
30
31
32
# File 'lib/malt/engines/sass.rb', line 27

def intermediate(params)
  text = params[:text]
  file = params[:file]
  type = params[:type]
  ::Sass::Engine.new(text, :filename=>file, :syntax=>type)
end

#render(params, &yld) ⇒ Object



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

def render(params, &yld)
  text   = params[:text]
  file   = params[:file]
  format = params[:format]

  case format
  when :css, nil
    engine = intermediate(params)
    engine.render
  else
    super(params, &yld)
  end
end