Class: Flickr::Photoset

Inherits:
Object show all
Defined in:
lib/acts_as_unvlogable/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.



692
693
694
695
696
# File 'lib/acts_as_unvlogable/flickr.rb', line 692

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.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def client
  @client
end

#descriptionObject (readonly)

Returns the value of attribute description.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def id
  @id
end

#ownerObject (readonly)

Returns the value of attribute owner.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def owner
  @owner
end

#photosObject (readonly)

Returns the value of attribute photos.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def photos
  @photos
end

#primaryObject (readonly)

Returns the value of attribute primary.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def primary
  @primary
end

#titleObject (readonly)

Returns the value of attribute title.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



690
691
692
# File 'lib/acts_as_unvlogable/flickr.rb', line 690

def url
  @url
end

Instance Method Details

#getInfoObject

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



700
701
702
703
704
705
706
707
708
709
# File 'lib/acts_as_unvlogable/flickr.rb', line 700

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