Class: ImageSqueeze::Processor
- Inherits:
-
Object
- Object
- ImageSqueeze::Processor
- Defined in:
- lib/image_squeeze/processors/processor.rb
Direct Known Subclasses
GIFToPNGProcessor, GifsicleProcessor, JPEGTranNonProgressiveProcessor, JPEGTranProgressiveProcessor, OptiPNGProcessor, PNGCrushProcessor, PNGToNonProgressiveJPEGProcessor, PNGToProgressiveJPEGProcessor
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Class Method Summary collapse
- .handles?(image_type) ⇒ Boolean
- .input_type ⇒ Object
-
.output_extension ⇒ Object
override if you want a different output extensions.
- .squeeze(filename, output_filename) ⇒ Object
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/image_squeeze/processors/processor.rb', line 3 def filename @filename end |
Class Method Details
.handles?(image_type) ⇒ Boolean
9 10 11 |
# File 'lib/image_squeeze/processors/processor.rb', line 9 def self.handles?(image_type) image_type == input_type end |
.input_type ⇒ Object
13 14 15 |
# File 'lib/image_squeeze/processors/processor.rb', line 13 def self.input_type raise "#{to_s}#input_type should be defined in subclass" end |
.output_extension ⇒ Object
override if you want a different output extensions
18 19 20 |
# File 'lib/image_squeeze/processors/processor.rb', line 18 def self.output_extension ImageSqueeze::IMAGE_TYPE_TO_EXTENSION[input_type] end |
.squeeze(filename, output_filename) ⇒ Object
5 6 7 |
# File 'lib/image_squeeze/processors/processor.rb', line 5 def self.squeeze(filename, output_filename) raise "#{to_s}#squeeze should be defined in subclass and should convert filename to something at output_filename" end |