Class: PaperclipCompression::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip-compression/base.rb

Direct Known Subclasses

Jpeg, Png

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
9
10
# File 'lib/paperclip-compression/base.rb', line 4

def initialize(file, options = {})
  @file             = file
  @options          = options
  @whiny            = options.has_key?(:whiny) ? options[:whiny] : true
  current_extension = File.extname(file.path)
  @basename         = File.basename(file.path, current_extension)
end

Class Method Details

.make(file, options = {}) ⇒ Object



12
13
14
# File 'lib/paperclip-compression/base.rb', line 12

def self.make(file, options = {})
  new(file, options).make
end