Class: ImageOptimizer::ImageOptimizerBase
- Inherits:
-
Object
- Object
- ImageOptimizer::ImageOptimizerBase
- Includes:
- Shell
- Defined in:
- lib/image_optimizer/image_optimizer_base.rb
Direct Known Subclasses
GIFOptimizer, JPEGOptimizer, PNGOptimizer, PNGQuantOptimizer
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ ImageOptimizerBase
constructor
A new instance of ImageOptimizerBase.
- #optimize ⇒ Object
Methods included from Shell
included, #run_command, #which
Constructor Details
#initialize(path, options = {}) ⇒ ImageOptimizerBase
Returns a new instance of ImageOptimizerBase.
6 7 8 9 |
# File 'lib/image_optimizer/image_optimizer_base.rb', line 6 def initialize(path, = {}) @path = path @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/image_optimizer/image_optimizer_base.rb', line 5 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/image_optimizer/image_optimizer_base.rb', line 5 def path @path end |
Instance Method Details
#optimize ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/image_optimizer/image_optimizer_base.rb', line 11 def optimize return unless correct_format? if optimizer_bin? perform_optimizations else warn "Attempting to optimize a #{type} without #{bin_name} installed. Skipping..." end end |