Class: BestImage::ImageFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/best_image/image_finder.rb

Direct Known Subclasses

ImageSelector

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImageFinder

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

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/best_image/image_finder.rb', line 3

def errors
  @errors
end

#imagesObject

Returns the value of attribute images.



3
4
5
# File 'lib/best_image/image_finder.rb', line 3

def images
  @images
end

#messagesObject

Returns the value of attribute messages.



3
4
5
# File 'lib/best_image/image_finder.rb', line 3

def messages
  @messages
end

Instance Method Details

#best_imageObject



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