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.
7 8 9 10 11 12 13 14 15 |
# File 'lib/sassc/rails/compressor.rb', line 7 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
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sassc/rails/compressor.rb', line 17 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 |