Class: Flickr::Api::Photo

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

Instance Method Summary collapse

Methods inherited from Abstract

#find

Instance Method Details

#add_tags(photo_id, tags, params = {}) ⇒ response

Parameters:

  • photo_id (String)
  • tags (String)

    Space-delimited list of tags (see documentation below)

Returns:

  • (response)

Documentation:


189
190
191
# File 'lib/flickr/api/photo.rb', line 189

def add_tags(photo_id, tags, params = {})
  post "photos.addTags", params.merge(photo_id: photo_id, tags: tags)
end

#delete(photo_id, params = {}) ⇒ response

Parameters:

  • photo_id (String)

Returns:

  • (response)

Documentation:


159
160
161
# File 'lib/flickr/api/photo.rb', line 159

def delete(photo_id, params = {})
  post "photos.delete", params.merge(photo_id: photo_id)
end

#get_exif(photo_id, params = {}) ⇒ Flickr::Object::Photo

Parameters:

  • photo_id (String)

Returns:

Documentation:


139
140
141
142
# File 'lib/flickr/api/photo.rb', line 139

def get_exif(photo_id, params = {})
  response = get "photos.getExif", params.merge(photo_id: photo_id)
  new_object(:Photo, response["photo"])
end

#get_favorites(photo_id, params = {}) ⇒ Flickr::Object::List<Flickr::Object::Person>

Parameters:

  • photo_id (String)

Returns:

Documentation:


149
150
151
152
# File 'lib/flickr/api/photo.rb', line 149

def get_favorites(photo_id, params = {})
  response = get "photos.getFavorites", params.merge(photo_id: photo_id)
  new_list(:Person, response["photo"]["person"], response["photo"])
end

#get_from_contacts(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


25
26
27
28
# File 'lib/flickr/api/photo.rb', line 25

def get_from_contacts(params = {})
  response = get "photos.getContactsPhotos", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_info(photo_id, params = {}) ⇒ Flickr::Object::Photo

Parameters:

  • photo_id (String)

Returns:

Documentation:


119
120
121
122
# File 'lib/flickr/api/photo.rb', line 119

def get_info(photo_id, params = {})
  response = get "photos.getInfo", params.merge(photo_id: photo_id)
  new_object(:Photo, response["photo"])
end

#get_interesting(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


61
62
63
64
# File 'lib/flickr/api/photo.rb', line 61

def get_interesting(params = {})
  response = get "interestingness.getList", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_not_in_set(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


37
38
39
40
# File 'lib/flickr/api/photo.rb', line 37

def get_not_in_set(params = {})
  response = get "photos.getNotInSet", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_recent(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


49
50
51
52
# File 'lib/flickr/api/photo.rb', line 49

def get_recent(params = {})
  response = get "photos.getRecent", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_recently_updated(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


109
110
111
112
# File 'lib/flickr/api/photo.rb', line 109

def get_recently_updated(params = {})
  response = get "photos.recentlyUpdated", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_sizes(photo_id, params = {}) ⇒ Flickr::Object::Photo

Parameters:

  • photo_id (String)

Returns:

Documentation:


129
130
131
132
# File 'lib/flickr/api/photo.rb', line 129

def get_sizes(photo_id, params = {})
  response = get "photos.getSizes", params.merge(photo_id: photo_id)
  new_object(:Photo, response)
end

#get_untagged(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


73
74
75
76
# File 'lib/flickr/api/photo.rb', line 73

def get_untagged(params = {})
  response = get "photos.getUntagged", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_with_geo_data(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


85
86
87
88
# File 'lib/flickr/api/photo.rb', line 85

def get_with_geo_data(params = {})
  response = get "photos.getWithGeoData", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#get_without_geo_data(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


97
98
99
100
# File 'lib/flickr/api/photo.rb', line 97

def get_without_geo_data(params = {})
  response = get "photos.getWithoutGeoData", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#remove_tag(photo_id, tag_id, params = {}) ⇒ response

Parameters:

  • photo_id (String)
  • tag_id (String)

Returns:

  • (response)

Documentation:


199
200
201
# File 'lib/flickr/api/photo.rb', line 199

def remove_tag(photo_id, tag_id, params = {})
  post "photos.removeTag", params.merge(photo_id: photo_id, tag_id: tag_id)
end

#search(params = {}) ⇒ Flickr::Object::List<Flickr::Object::Photo>

Parameters:

  • 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:


13
14
15
16
# File 'lib/flickr/api/photo.rb', line 13

def search(params = {})
  response = get "photos.search", params
  new_list(:Photo, response["photos"]["photo"], response["photos"])
end

#set_content_type(photo_id, content_type, params = {}) ⇒ response

Parameters:

  • photo_id (String)
  • content_type (String)

Returns:

  • (response)

Documentation:


169
170
171
# File 'lib/flickr/api/photo.rb', line 169

def set_content_type(photo_id, content_type, params = {})
  post "photos.setContentType", params.merge(photo_id: photo_id, content_type: content_type)
end

#set_dates(photo_id, params = {}) ⇒ response

Parameters:

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

    See documentation below

Returns:

  • (response)

Documentation:


209
210
211
# File 'lib/flickr/api/photo.rb', line 209

def set_dates(photo_id, params = {})
  post "photos.setDates", params.merge(photo_id: photo_id)
end

#set_license(photo_id, license_id, params = {}) ⇒ response

Parameters:

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

    See documentation below

Returns:

  • (response)

Documentation:


248
249
250
# File 'lib/flickr/api/photo.rb', line 248

def set_license(photo_id, license_id, params = {})
  post "photos.licenses.setLicense", params.merge(photo_id: photo_id, license_id: license_id)
end

#set_meta(photo_id, params = {}) ⇒ response

Parameters:

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

    See documentation below

Returns:

  • (response)

Documentation:


219
220
221
# File 'lib/flickr/api/photo.rb', line 219

def set_meta(photo_id, params = {})
  post "photos.setMeta", params.merge(photo_id: photo_id)
end

#set_permissions(photo_id, params = {}) ⇒ response

Parameters:

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

    See documentation below

Returns:

  • (response)

Documentation:


229
230
231
# File 'lib/flickr/api/photo.rb', line 229

def set_permissions(photo_id, params = {})
  post "photos.setPerms", params.merge(photo_id: photo_id)
end

#set_safety_level(photo_id, params = {}) ⇒ response

Parameters:

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

    See documentation below

Returns:

  • (response)

Documentation:


239
240
241
# File 'lib/flickr/api/photo.rb', line 239

def set_safety_level(photo_id, params = {})
  post "photos.setSafetyLevel", params.merge(photo_id: photo_id)
end

#set_tags(photo_id, tags, params = {}) ⇒ response

Parameters:

  • photo_id (String)
  • tags (String)

    Space-delimited list of tags (see documentation below)

Returns:

  • (response)

Documentation:


179
180
181
# File 'lib/flickr/api/photo.rb', line 179

def set_tags(photo_id, tags, params = {})
  post "photos.setTags", params.merge(photo_id: photo_id, tags: tags)
end