Class: BestImage::ImageFinder
- Inherits:
-
Object
- Object
- BestImage::ImageFinder
- Defined in:
- lib/best_image/image_finder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#images ⇒ Object
Returns the value of attribute images.
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #best_image ⇒ Object
-
#initialize ⇒ ImageFinder
constructor
A new instance of ImageFinder.
- #parse(path) ⇒ Object
Constructor Details
#initialize ⇒ ImageFinder
Returns a new instance of ImageFinder.
5 6 7 |
# File 'lib/best_image/image_finder.rb', line 5 def initialize @errors = []; @messages = []; @images = [] end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/best_image/image_finder.rb', line 3 def errors @errors end |
#images ⇒ Object
Returns the value of attribute images.
3 4 5 |
# File 'lib/best_image/image_finder.rb', line 3 def images @images end |
#messages ⇒ Object
Returns the value of attribute messages.
3 4 5 |
# File 'lib/best_image/image_finder.rb', line 3 def @messages end |
Instance Method Details
#best_image ⇒ Object
18 19 20 |
# File 'lib/best_image/image_finder.rb', line 18 def best_image @best_image ||= calculate_best_image end |
#parse(path) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/best_image/image_finder.rb', line 9 def parse(path) set_uri(path) set_response set_doc set_images rescue IOError => e self end |