Class: PaperclipCompression::Base
- Inherits:
-
Object
- Object
- PaperclipCompression::Base
- Defined in:
- lib/paperclip-compression/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, first_processor, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(file, first_processor, options = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/paperclip-compression/base.rb', line 4 def initialize(file, first_processor, = {}) @file = file @options = @whiny = .has_key?(:whiny) ? [:whiny] : true current_extension = File.extname(file.path) @basename = File.basename(file.path, current_extension) @dst = Paperclip::TempfileFactory.new.generate("#{@basename}.png") @dst_path = File.(@dst.path) @src_path = File.(@file.path) @first_processor = first_processor end |
Class Method Details
.make(file, first_processor, options = {}) ⇒ Object
16 17 18 |
# File 'lib/paperclip-compression/base.rb', line 16 def self.make(file, first_processor, = {}) new(file, first_processor, ).make end |