Class: Sprockets::LazyCompressor
- Defined in:
- actionpack/lib/sprockets/compressors.rb
Instance Method Summary collapse
- #compress(content) ⇒ Object
- #compressor ⇒ Object
-
#initialize(&block) ⇒ LazyCompressor
constructor
A new instance of LazyCompressor.
Constructor Details
#initialize(&block) ⇒ LazyCompressor
Returns a new instance of LazyCompressor.
9 10 11 |
# File 'actionpack/lib/sprockets/compressors.rb', line 9 def initialize(&block) @block = block end |
Instance Method Details
#compress(content) ⇒ Object
17 18 19 |
# File 'actionpack/lib/sprockets/compressors.rb', line 17 def compress(content) compressor.compress(content) end |
#compressor ⇒ Object
13 14 15 |
# File 'actionpack/lib/sprockets/compressors.rb', line 13 def compressor @compressor ||= @block.call || NullCompressor.new end |