Class: Flickrage::Service::Resizer
- Inherits:
-
Object
- Object
- Flickrage::Service::Resizer
- Includes:
- Helpers::Log
- Defined in:
- lib/flickrage/service/resizer.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width, height) ⇒ Resizer
constructor
A new instance of Resizer.
- #run(image) ⇒ Object
Methods included from Helpers::Log
Constructor Details
#initialize(width, height) ⇒ Resizer
Returns a new instance of Resizer.
9 10 11 12 |
# File 'lib/flickrage/service/resizer.rb', line 9 def initialize(width, height) @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
7 8 9 |
# File 'lib/flickrage/service/resizer.rb', line 7 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'lib/flickrage/service/resizer.rb', line 7 def width @width end |
Instance Method Details
#run(image) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/flickrage/service/resizer.rb', line 14 def run(image) return image unless image.downloaded? resize_to_fill(image) check_image(image) rescue => e logger.debug(e) image end |