Class: FlickrbCollage::FlickrPhotoUrl

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = '', flicker = FlickrConfig.call) ⇒ FlickrPhotoUrl

Returns a new instance of FlickrPhotoUrl.



5
6
7
8
# File 'lib/flickrb_collage/flickr_photo_url.rb', line 5

def initialize(id = '', flicker = FlickrConfig.call)
  @flicker = flicker
  @id = id
end

Instance Attribute Details

#flickerObject (readonly)

Returns the value of attribute flicker.



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

def flicker
  @flicker
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Instance Method Details

#callObject



10
11
12
13
14
# File 'lib/flickrb_collage/flickr_photo_url.rb', line 10

def call
  # Get the last size. Usually, it is the original size.
  # using fixnum because it doesnt respond to last method.
  flicker.photos.getSizes(photo_id: id)[-1].source
end