Class: ViewAssets::Packager::Compressor

Inherits:
Object
  • Object
show all
Defined in:
lib/view_assets/packager/packager.rb

Instance Method Summary collapse

Constructor Details

#initializeCompressor

Returns a new instance of Compressor.



97
98
99
# File 'lib/view_assets/packager/packager.rb', line 97

def initialize
  @engines = {} # { :engine_id => engine }
end

Instance Method Details

#compress(engine_id, content) ⇒ Object

Raises:



105
106
107
108
109
# File 'lib/view_assets/packager/packager.rb', line 105

def compress(engine_id, content)
  raise Error.new("Compress Engine #{engine_id} Is Not Supported") if @engines[engine_id].nil?

  @engines[engine_id].compress(content)
end

#register(engine_id, engine) ⇒ Object



101
102
103
# File 'lib/view_assets/packager/packager.rb', line 101

def register(engine_id, engine)
  @engines[engine_id] = engine
end