Class: Flickr::Photosets::Photoset
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#num_photos ⇒ Object
Returns the value of attribute num_photos.
-
#primary_photo_id ⇒ Object
Returns the value of attribute primary_photo_id.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #add_photo(photo_id) ⇒ Object
- #get_photos(options = {}) ⇒ Object
-
#initialize(flickr, attributes) ⇒ Photoset
constructor
A new instance of Photoset.
Constructor Details
#initialize(flickr, attributes) ⇒ Photoset
Returns a new instance of Photoset.
4 5 6 7 8 9 |
# File 'lib/flickr/photoset.rb', line 4 def initialize(flickr, attributes) @flickr = flickr attributes.each do |k,v| send("#{k}=", v) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/flickr/photoset.rb', line 2 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/flickr/photoset.rb', line 2 def id @id end |
#num_photos ⇒ Object
Returns the value of attribute num_photos.
2 3 4 |
# File 'lib/flickr/photoset.rb', line 2 def num_photos @num_photos end |
#primary_photo_id ⇒ Object
Returns the value of attribute primary_photo_id.
2 3 4 |
# File 'lib/flickr/photoset.rb', line 2 def primary_photo_id @primary_photo_id end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/flickr/photoset.rb', line 2 def title @title end |
Instance Method Details
#add_photo(photo_id) ⇒ Object
17 18 19 |
# File 'lib/flickr/photoset.rb', line 17 def add_photo(photo_id) rsp = @flickr.send_request('flickr.photosets.addPhoto', {:photo_id=>photo_id, :photoset_id => id}) end |
#get_photos(options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/flickr/photoset.rb', line 11 def get_photos(={}) = .merge(:photoset_id=>id) rsp = @flickr.send_request('flickr.photosets.getPhotos', ) collect_photos(rsp) end |