Class: FlickrbCollage::FlickrPhotoFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/flickrb_collage/flickr_photo_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#flickrObject (readonly)

Returns the value of attribute flickr.



3
4
5
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 3

def flickr
  @flickr
end

#keywordObject (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

#callObject



10
11
12
# File 'lib/flickrb_collage/flickr_photo_finder.rb', line 10

def call
  flickr.photos.search(text: keyword).first
end