Class: ImageSqueeze::Result
- Inherits:
-
Object
- Object
- ImageSqueeze::Result
- Defined in:
- lib/image_squeeze/result.rb
Instance Attribute Summary collapse
-
#bytes_saved ⇒ Object
readonly
Returns the value of attribute bytes_saved.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#output_extension ⇒ Object
readonly
Returns the value of attribute output_extension.
-
#output_filename ⇒ Object
readonly
Returns the value of attribute output_filename.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(options = {}) ⇒ Result
constructor
A new instance of Result.
- #optimized? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Result
Returns a new instance of Result.
5 6 7 8 9 10 |
# File 'lib/image_squeeze/result.rb', line 5 def initialize( = {}) @filename = [:filename] @output_filename = [:output_filename] @bytes_saved = [:bytes_saved] @output_extension = [:output_extension] end |
Instance Attribute Details
#bytes_saved ⇒ Object (readonly)
Returns the value of attribute bytes_saved.
3 4 5 |
# File 'lib/image_squeeze/result.rb', line 3 def bytes_saved @bytes_saved end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/image_squeeze/result.rb', line 3 def filename @filename end |
#output_extension ⇒ Object (readonly)
Returns the value of attribute output_extension.
3 4 5 |
# File 'lib/image_squeeze/result.rb', line 3 def output_extension @output_extension end |
#output_filename ⇒ Object (readonly)
Returns the value of attribute output_filename.
3 4 5 |
# File 'lib/image_squeeze/result.rb', line 3 def output_filename @output_filename end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/image_squeeze/result.rb', line 16 def <=>(other) self.bytes_saved <=> other.bytes_saved end |
#optimized? ⇒ Boolean
12 13 14 |
# File 'lib/image_squeeze/result.rb', line 12 def optimized? bytes_saved.to_i > 0 end |