Class: Sprockets::SassCompressor
- Inherits:
-
Object
- Object
- Sprockets::SassCompressor
- Defined in:
- lib/sassc/rails/compressor.rb
Instance Method Summary collapse
- #call(*args) ⇒ Object (also: #evaluate)
-
#initialize(options = {}) ⇒ SassCompressor
constructor
A new instance of SassCompressor.
Constructor Details
#initialize(options = {}) ⇒ SassCompressor
Returns a new instance of SassCompressor.
8 9 10 11 12 13 14 15 16 |
# File 'lib/sassc/rails/compressor.rb', line 8 def initialize( = {}) @options = { syntax: :scss, cache: false, read_cache: false, style: :compressed }.merge().freeze @cache_key = SecureRandom.uuid end |
Instance Method Details
#call(*args) ⇒ Object Also known as: evaluate
18 19 20 21 22 23 24 25 26 |
# File 'lib/sassc/rails/compressor.rb', line 18 def call(*args) input = if defined?(data) data # sprockets 2.x else args[0][:data] # sprockets 3.x end SassC::Engine.new(input, { style: :compressed }).render end |