Class: Myflickr::Set
- Inherits:
-
Struct
- Object
- Struct
- Myflickr::Set
- Defined in:
- lib/myflickr/set.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#photo_count ⇒ Object
Returns the value of attribute photo_count.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
-
.find(id) ⇒ Object
Get information regarding set by searching with the set’s ID.
-
.list ⇒ Object
Get a list of available photosets.
Instance Method Summary collapse
-
#photos ⇒ Object
Get the photos within a set Queries: > photosets.getPhotos (1 call) > Photo.find ID (n calls).
-
#tags ⇒ Object
Return a list of tags for the set (This is rough as guts as far as queries go).
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description
2 3 4 |
# File 'lib/myflickr/set.rb', line 2 def description @description end |
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/myflickr/set.rb', line 2 def id @id end |
#photo_count ⇒ Object
Returns the value of attribute photo_count
2 3 4 |
# File 'lib/myflickr/set.rb', line 2 def photo_count @photo_count end |
#title ⇒ Object
Returns the value of attribute title
2 3 4 |
# File 'lib/myflickr/set.rb', line 2 def title @title end |
Class Method Details
Instance Method Details
#photos ⇒ Object
Get the photos within a set Queries: > photosets.getPhotos (1 call) > Photo.find ID (n calls)
17 18 19 20 21 |
# File 'lib/myflickr/set.rb', line 17 def photos (Query.api_call('flickr.photosets.getPhotos', "photoset_id=#{id}")/:photo).parallel_map(MAX_THREADS) do |photo| Photo.find photo[:id] end end |
#tags ⇒ Object
Return a list of tags for the set (This is rough as guts as far as queries go)
24 25 26 27 28 29 30 31 32 |
# File 'lib/myflickr/set.rb', line 24 def = [] photos.each do |photo| photo..each do |tag| << tag[:value] end end .uniq end |