Class: Flickr::Contacts

Inherits:
Base show all
Defined in:
lib/flickr/contacts.rb

Defined Under Namespace

Classes: Contact

Constant Summary

Constants inherited from Base

Base::AUTH_ENDPOINT, Base::REST_ENDPOINT, Base::UPLOAD_ENDPOINT

Instance Attribute Summary

Attributes inherited from Base

#api_key, #api_secret, #token, #token_cache

Instance Method Summary collapse

Methods inherited from Base

#auth, #contacts, #people, #photos, #photosets, #send_request, #sign_request, #test, #uploader, #urls

Constructor Details

#initialize(flickr) ⇒ Contacts

Returns a new instance of Contacts.



2
3
4
# File 'lib/flickr/contacts.rb', line 2

def initialize(flickr)
  @flickr = flickr
end

Instance Method Details

#get_list(options = {}) ⇒ Object

Get the authorized user’s contact list.



21
22
23
24
# File 'lib/flickr/contacts.rb', line 21

def get_list(options={})
  rsp = @flickr.send_request('flickr.contacts.getList', options)
  collect_contacts(rsp)
end

#get_public_list(id, options = {}) ⇒ Object

Get a user’s public contact list.

Params

  • id (Required)

    the nsid of the user to get information for
    


12
13
14
15
16
# File 'lib/flickr/contacts.rb', line 12

def get_public_list(id, options={})
  options.merge!({:user_id => id})
  rsp = @flickr.send_request('flickr.contacts.getPublicList', options)
  collect_contacts(rsp)
end