module EyeEmConnector::Client::Photos
Public Instance Methods
add_photo_to_album(photo_id,album_id)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 83 def add_photo_to_album(photo_id,album_id) response = put("photos/#{photo_id}/albums/#{album_id}",true) end
add_photo_to_topic(photo_id,topic)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 61 def add_photo_to_topic(photo_id,topic) response = post("photos/#{photo_id}/topics",options.merge(:topic => topic),true) end
create_photo(photo,options={})
click to toggle source
POST
# File lib/EyeEmConnector/models/photos.rb, line 51 def create_photo(photo,options={}) #expects file object, valid image types not defined in the api response = post("photos",options.merge(:photo => photo)) response.body end
create_photo_comment(photo_id,message,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 56 def create_photo_comment(photo_id,message,options={}) response = post("photos/#{photo_id}/comments",options.merge(:message => message)) response.body end
delete_photo(photo_id)
click to toggle source
DELETE
# File lib/EyeEmConnector/models/photos.rb, line 89 def delete_photo(photo_id) response = delete("photos/#{photo_id}",true) end
delete_photo_comment(photo_id,comment_id)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 97 def delete_photo_comment(photo_id,comment_id) response = delete("photos/#{photo_id}/comments/#{comment_id}",true) end
flag_photo(photo_id,offense)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 65 def flag_photo(photo_id,offense) response = post("photos/#{photo_id}/flag",options.merge(:offense => offense),true) end
like_photo(photo_id,liker_id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 79 def like_photo(photo_id,liker_id,options={}) response = put("photos/#{photo_id}/likers/#{liker_id}",options,true) end
photo(id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 15 def photo(id,options={}) response = get('photos/'+id.to_s,options) response.body end
photo_albums(id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 39 def photo_albums(id,options={}) response = get('photos/'+id.to_s+'/albums',options) response.body end
photo_comment(photo_id,contributer_id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 34 def photo_comment(photo_id,contributer_id,options={}) response = get("photos/#{photo_id.to_s}/comments/#{contributer_id}",options) response.body end
photo_comments(id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 29 def photo_comments(id,options={}) response = get('photos/'+id.to_s+'/comments',options) response.body end
photo_liker(photo_id,liker_id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 25 def photo_liker(photo_id,liker_id,options={}) response = get("photos/#{photo_id.to_s}/likers/#{liker_id}",options,true) end
photo_likers(id,options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 20 def photo_likers(id,options={}) response = get('photos/'+id.to_s+'/likers',options) response.body end
photos(options={})
click to toggle source
GET Request
# File lib/EyeEmConnector/models/photos.rb, line 10 def photos(options={}) #access token needed, returns photos of authenticated user response = get('photos',options) response.body end
random_photo(options={})
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 44 def random_photo(options={}) response = get('api/popular/random',options) response.body end
remove_photo_to_album(photo_id,album_id)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 101 def remove_photo_to_album(photo_id,album_id) response = delete("photos/#{photo_id}/albums/#{album_id}",true) end
unlike_photo(photo_id,liker_id)
click to toggle source
# File lib/EyeEmConnector/models/photos.rb, line 93 def unlike_photo(photo_id,liker_id) response = delete("photos/#{photo_id}/likers/#{liker_id}",options,true) end
update_photo(photo_id,options={})
click to toggle source
PUT
# File lib/EyeEmConnector/models/photos.rb, line 75 def update_photo(photo_id,options={}) response = put("photos/#{photo_id}",true) end