Class: ImageOptimizer
- Inherits:
-
Object
- Object
- ImageOptimizer
- Includes:
- Shell
- Defined in:
- lib/image_optimizer.rb,
lib/image_optimizer/shell.rb,
lib/image_optimizer/version.rb,
lib/image_optimizer/png_optimizer.rb,
lib/image_optimizer/jpeg_optimizer.rb,
lib/image_optimizer/image_optimizer_base.rb
Defined Under Namespace
Modules: Shell Classes: ImageOptimizerBase, JPEGOptimizer, PNGOptimizer
Constant Summary collapse
- VERSION =
'1.5.0'
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 = {}) ⇒ ImageOptimizer
constructor
A new instance of ImageOptimizer.
- #optimize ⇒ Object
Methods included from Shell
included, #run_command, #which
Constructor Details
#initialize(path, options = {}) ⇒ ImageOptimizer
Returns a new instance of ImageOptimizer.
11 12 13 14 |
# File 'lib/image_optimizer.rb', line 11 def initialize(path, = {}) @path = path = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/image_optimizer.rb', line 10 def end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/image_optimizer.rb', line 10 def path @path end |
Instance Method Details
#optimize ⇒ Object
16 17 18 19 20 |
# File 'lib/image_optimizer.rb', line 16 def optimize identify_format if [:identify] JPEGOptimizer.new(path, ).optimize PNGOptimizer.new(path, ).optimize end |