Class: Flickr::Api::Person

Inherits:
Abstract show all
Defined in:
lib/flickr/api/person.rb

Instance Method Summary collapse

Methods inherited from Abstract

#find

Instance Method Details

#find_by_email(email, params = {}) ⇒ Flickr::Object::Person

Parameters:

  • email (String)

Returns:

Documentation:


11
12
13
14
# File 'lib/flickr/api/person.rb', line 11

def find_by_email(email, params = {})
  response = get "people.findByEmail", params.merge(find_email: email)
  new_object(:Person, response["user"])
end

#find_by_username(username, params = {}) ⇒ Flickr::Object::Person

Parameters:

  • username (String)

Returns:

Documentation:


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

def find_by_username(username, params = {})
  response = get "people.findByUsername", params.merge(username: username)
  new_object(:Person, response["user"])
end

#get_info(person_id, params = {}) ⇒ Flickr::Object::Person

Parameters:

  • person_id (String)

Returns:

Documentation:


40
41
42
43
# File 'lib/flickr/api/person.rb', line 40

def get_info(person_id, params = {})
  response = get "people.getInfo", params.merge(user_id: person_id)
  new_object(:Person, response["person"])
end

#get_photos(person_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • person_id (String)
  • params (Hash) (defaults to: {})

    See documentation below

Options Hash (params):

  • :sizes (Boolean, Array<String>)

    For all sizes use true, for specific ones chuck them into an array (e.g. ["Square 75", "Medium 500"]).

Returns:

Documentation:


53
54
55
56
# File 'lib/flickr/api/person.rb', line 53

def get_photos(person_id, params = {})
  response = get "people.getPhotos", params.merge(user_id: person_id)
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_photos_of(person_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • person_id (String)
  • params (Hash) (defaults to: {})

    See documentation below

Options Hash (params):

  • :sizes (Boolean, Array<String>)

    For all sizes use true, for specific ones chuck them into an array (e.g. ["Square 75", "Medium 500"]).

Returns:

Documentation:


66
67
68
69
# File 'lib/flickr/api/person.rb', line 66

def get_photos_of(person_id, params = {})
  response = get "people.getPhotosOf", params.merge(user_id: person_id)
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_public_photos(person_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • person_id (String)
  • params (Hash) (defaults to: {})

    See documentation below

Options Hash (params):

  • :sizes (Boolean, Array<String>)

    For all sizes use true, for specific ones chuck them into an array (e.g. ["Square 75", "Medium 500"]).

Returns:

Documentation:


79
80
81
82
# File 'lib/flickr/api/person.rb', line 79

def get_public_photos(person_id, params = {})
  response = get "people.getPublicPhotos", params.merge(user_id: person_id)
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_public_photos_from_contacts(person_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • person_id (String)
  • params (Hash) (defaults to: {})

    See documentation below

Options Hash (params):

  • :sizes (Boolean, Array<String>)

    For all sizes use true, for specific ones chuck them into an array (e.g. ["Square 75", "Medium 500"]).

Returns:

Documentation:


92
93
94
95
# File 'lib/flickr/api/person.rb', line 92

def get_public_photos_from_contacts(person_id, params = {})
  response = get "photos.getContactsPublicPhotos", params.merge(user_id: person_id)
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_sets(person_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Set>

Parameters:

  • person_id (String)
  • params (Hash) (defaults to: {})

    See documentation below

Returns:

Documentation:


103
104
105
106
# File 'lib/flickr/api/person.rb', line 103

def get_sets(person_id, params = {})
  response = get "photosets.getList", params.merge(user_id: person_id)
  new_list(:Set, response["photosets"]["photoset"], response["photosets"])
end

#get_upload_status(params = {}) ⇒ Flickr::Object::Person::UploadStatus


30
31
32
33
# File 'lib/flickr/api/person.rb', line 30

def get_upload_status(params = {})
  response = get "people.getUploadStatus", params
  new_object(:UploadStatus, response["user"])
end