Sha256: b27617a9483f4c8cf2382f2da8d89ff0f8c51c2e144a6b9fa5b69d96c589741a

Contents?: true

Size: 926 Bytes

Versions: 16

Compression:

Stored size: 926 Bytes

Contents

class Flickr::Photosets::Photoset
  attr_accessor :id,:num_photos,: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
  
  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]}
    end
end

Version data entries

16 entries across 16 versions & 6 rubygems

Version Path
rmm5t-flickr_fu-0.3.1 lib/flickr/photoset.rb
rschenk-flickr_fu-0.3.2 lib/flickr/photoset.rb
fotonauts-flickr_fu-0.3.4 lib/flickr/photoset.rb
fotonauts-flickr_fu-0.3.3 lib/flickr/photoset.rb
fotonauts-flickr_fu-0.3.2 lib/flickr/photoset.rb
tomk32-flickr_fu-0.3.4.1 lib/flickr/photoset.rb
tomk32-flickr_fu-0.3.3 lib/flickr/photoset.rb
tomk32-flickr_fu-0.3.2 lib/flickr/photoset.rb
tomk32-flickr_fu-0.3.1 lib/flickr/photoset.rb
robsharp-flickr_fu-0.3.0 lib/flickr/photoset.rb
flickr_fu-0.3.0 lib/flickr/photoset.rb
tomk32-flickr_fu-0.3.0 lib/flickr/photoset.rb
rmm5t-flickr_fu-0.3.5 lib/flickr/photoset.rb
rmm5t-flickr_fu-0.3.4 lib/flickr/photoset.rb
rmm5t-flickr_fu-0.3.3 lib/flickr/photoset.rb
rmm5t-flickr_fu-0.3.2 lib/flickr/photoset.rb