Class: Hanami::Assets::Compressors::SassStylesheet Private

Inherits:
Stylesheet show all
Defined in:
lib/hanami/assets/compressors/sass_stylesheet.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Sass compressor for stylesheet

It depends on sassc gem.

Instance Method Summary collapse

Methods inherited from Stylesheet

for

Constructor Details

#initializeSassStylesheet

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SassStylesheet.

Since:

  • 0.1.0



18
19
20
21
# File 'lib/hanami/assets/compressors/sass_stylesheet.rb', line 18

def initialize
  require 'sassc'
  @compressor = ::SassC::Engine
end

Instance Method Details

#compress(filename) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



25
26
27
28
29
30
31
32
# File 'lib/hanami/assets/compressors/sass_stylesheet.rb', line 25

def compress(filename)
  compressor.new(
    read(filename),
    filename: filename,
    syntax: :scss,
    style: :compressed
  ).render
end