Class: FlickrbCollage::FlickrPhotoFinder
- Inherits:
-
Object
- Object
- FlickrbCollage::FlickrPhotoFinder
- Defined in:
- lib/flickrb_collage/flickr_photo_finder.rb
Instance Attribute Summary collapse
-
#flickr ⇒ Object
readonly
Returns the value of attribute flickr.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(keyword = '', flickr = FlickrConfig.call) ⇒ FlickrPhotoFinder
constructor
A new instance of FlickrPhotoFinder.
Constructor Details
#initialize(keyword = '', flickr = FlickrConfig.call) ⇒ FlickrPhotoFinder
Returns a new instance of FlickrPhotoFinder.
5 6 7 8 |
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 5 def initialize(keyword = '', flickr = FlickrConfig.call) @flickr = flickr @keyword = keyword end |
Instance Attribute Details
#flickr ⇒ Object (readonly)
Returns the value of attribute flickr.
3 4 5 |
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 3 def flickr @flickr end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
3 4 5 |
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 3 def keyword @keyword end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 10 def call flickr.photos.search(text: keyword).first end |