Sha256: 93f93e7df0077c4a1a14782fac73af738534b7b9ae77bfc347507fa47c566351
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
class Flickr::Photosets::Photoset attr_accessor :id, :num_photos, :primary, :secret, :farm, :server, :title, :description def initialize(flickr, attributes) @flickr = flickr attributes.each do |k,v| send("#{k}=", v) end end def get_photos(options={}) options = options.merge(:photoset_id=>id) rsp = @flickr.send_request('flickr.photosets.getPhotos', options) collect_photos(rsp) end def primary_photo_url "http://farm#{farm}.static.flickr.com/#{server}/#{primary}_#{secret}_s.jpg" end protected def collect_photos(rsp) photos = [] return photos unless rsp if rsp.photoset.photo rsp.photoset.photo.each do |photo| attributes = create_attributes(photo) photos << Flickr::Photos::Photo.new(@flickr,attributes) end end return photos end def create_attributes(photo) { :id => photo[:id], :secret => photo[:secret], :server => photo[:server], :farm => photo[:farm], :title => photo[:title], :url_l => photo[:url_l] } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ayn-flickr_fu-0.3.6 | lib/flickr/photoset.rb |
ayn-flickr_fu-0.3.7 | lib/flickr/photoset.rb |