class Sprockets::Rails::LazyCompressor
:nodoc:#compress
is called the first time.
This postpones the initialization of the compressor until
engine when needed.
An asset compressor which only initializes the underlying compression
def compress(content)
def compress(content) compressor.compress(content) end
def compressor
def compressor @compressor ||= (@block.call || NullCompressor.new) end
def initialize(&block)
#compress
.The block should return a compressor when called, i.e. an object
Initializes a new LazyCompressor.
:nodoc:
#compress
is called the first time.This postpones the initialization of the compressor until
engine when needed.
An asset compressor which only initializes the underlying compression
def initialize(&block) @block = block end