Class: Flickr::Photoset

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

Overview

Todo: flickr.photosets.delete flickr.photosets.editMeta flickr.photosets.editPhotos flickr.photosets.getContext flickr.photosets.getInfo flickr.photosets.getPhotos

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, api_key = nil) ⇒ Photoset

Returns a new instance of Photoset.



674
675
676
677
678
# File 'lib/flickr.rb', line 674

def initialize(id=nil, api_key=nil)
  @id = id
  @api_key = api_key
  @client = Flickr.new @api_key
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



672
673
674
# File 'lib/flickr.rb', line 672

def client
  @client
end

#descriptionObject (readonly)

Returns the value of attribute description.



672
673
674
# File 'lib/flickr.rb', line 672

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



672
673
674
# File 'lib/flickr.rb', line 672

def id
  @id
end

#ownerObject (readonly)

Returns the value of attribute owner.



672
673
674
# File 'lib/flickr.rb', line 672

def owner
  @owner
end

#photosObject (readonly)

Returns the value of attribute photos.



672
673
674
# File 'lib/flickr.rb', line 672

def photos
  @photos
end

#primaryObject (readonly)

Returns the value of attribute primary.



672
673
674
# File 'lib/flickr.rb', line 672

def primary
  @primary
end

#titleObject (readonly)

Returns the value of attribute title.



672
673
674
# File 'lib/flickr.rb', line 672

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



672
673
674
# File 'lib/flickr.rb', line 672

def url
  @url
end

Instance Method Details

#getInfoObject

Implements flickr.photosets.getInfo private, once we can call it as needed



682
683
684
685
686
687
688
689
690
691
# File 'lib/flickr.rb', line 682

def getInfo
  info = @client.photosets_getInfo('photoset_id'=>@id)['photoset']
  @owner = User.new(info['owner'], nil, nil, nil, @api_key)
  @primary = info['primary']
  @photos = info['photos']
  @title = info['title']
  @description = info['description']
  @url = "http://www.flickr.com/photos/#{@owner.getInfo.username}/sets/#{@id}/"
  self
end