Class: ImageOptimizer::PNGOptimizer
- Inherits:
-
Object
- Object
- ImageOptimizer::PNGOptimizer
- Defined in:
- lib/image_optimizer/png_optimizer.rb
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 = {}) ⇒ PNGOptimizer
constructor
A new instance of PNGOptimizer.
- #optimize ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ PNGOptimizer
Returns a new instance of PNGOptimizer.
5 6 7 8 |
# File 'lib/image_optimizer/png_optimizer.rb', line 5 def initialize(path, = {}) @path = path = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/image_optimizer/png_optimizer.rb', line 3 def end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/image_optimizer/png_optimizer.rb', line 3 def path @path end |
Instance Method Details
#optimize ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/image_optimizer/png_optimizer.rb', line 10 def optimize return unless png_format? if png_optimizer_present? optimize_png else warn 'Attempting to optimize a png without optipng installed. Skipping...' end end |