class Flickr::Api::General
Public Instance Methods
@return [Array<String>] @docs [flickr.reflection.getMethods](www.flickr.com/services/api/flickr.reflection.getMethods.html)
# File lib/flickr/api/general.rb, line 45 def get_methods(params = {}) response = get "reflection.getMethods", params response["methods"]["method"].map { |hash| hash["_content"] } end
@example
photo = File.open("/path/to/dandelions.jpg") Flickr.replace(photo, photo_id, title: "Dandelions")
@param photo [String, File, Rails, Sinatra] Photo
to upload @param photo_id [String] ID of the photo which will be replaced @param params [Hash] See documentation below @return [String] ID of the uploaded photo (if synchronous) @return [String] ID of the upload ticket (if asynchronous) @docs [Replace API](www.flickr.com/services/api/replace.api.html) @docs [Asynchronous Uploading](www.flickr.com/services/api/upload.async.html)
Flickr::Api::Abstract#replace
# File lib/flickr/api/general.rb, line 36 def replace(photo, photo_id, params = {}) response = super params.merge(photo: SanitizedFile.new(photo), photo_id: photo_id) params[:async] == 1 ? response["ticketid"] : response["photoid"]["__content__"] end
@return [Hash] @docs [flickr.test.echo](www.flickr.com/services/api/flickr.test.echo.html)
# File lib/flickr/api/general.rb, line 62 def test_echo(params = {}) get "test.echo", params end
@return [Hash] @docs [flickr.test.login](www.flickr.com/services/api/flickr.test.login.html)
# File lib/flickr/api/general.rb, line 54 def test_login(params = {}) get "test.login", params end
@return [Hash] @docs [flickr.test.null](www.flickr.com/services/api/flickr.test.null.html)
# File lib/flickr/api/general.rb, line 70 def test_null(params = {}) get "test.null", params end
@example
photo = File.open("/path/to/dandelions.jpg") Flickr.upload(photo, title: "Dandelions")
@param photo [String, File, Rails, Sinatra] Photo
to upload @param params [Hash] See documentation below @return [String] ID of the uploaded photo (if synchronous) @return [String] ID of the upload ticket (if asynchronous). See {Flickr::Api::UploadTicket#check}. @docs [Upload API](www.flickr.com/services/api/upload.api.html) @docs [Asynchronous Uploading](www.flickr.com/services/api/upload.async.html)
Flickr::Api::Abstract#upload
# File lib/flickr/api/general.rb, line 19 def upload(photo, params = {}) response = super params.merge(photo: SanitizedFile.new(photo)) params[:async] == 1 ? response["ticketid"] : response["photoid"] end