Class: ViewAssets::Packager::Compressor
- Inherits:
-
Object
- Object
- ViewAssets::Packager::Compressor
- Defined in:
- lib/view_assets/packager/packager.rb
Instance Method Summary collapse
- #compress(engine_id, content) ⇒ Object
-
#initialize ⇒ Compressor
constructor
A new instance of Compressor.
- #register(engine_id, engine) ⇒ Object
Constructor Details
#initialize ⇒ Compressor
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
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 |