Class: Jammit::SassCompressor

Inherits:
Object
  • Object
show all
Defined in:
lib/jammit/sass_compressor.rb

Overview

Wraps sass’ css compressor to use the same API as the rest of Jammit’s compressors.

Instance Method Summary (collapse)

Constructor Details

- (SassCompressor) initialize(options = {})

Creates a new sass compressor. Jammit::SassCompressor doesn’t use any options, the options parameter is there for API compatibility.



7
8
# File 'lib/jammit/sass_compressor.rb', line 7

def initialize(options = {})
end

Instance Method Details

- (Object) compress(css)

Compresses css using sass’ CSS parser, and returns the compressed css.



12
13
14
# File 'lib/jammit/sass_compressor.rb', line 12

def compress(css)
  ::Sass::Engine.new(css, :syntax => :scss, :style => :compressed).render.strip
end