Module: Uploadcare::RawApi

Included in:
Api
Defined in:
lib/uploadcare/api/raw_api.rb

Instance Method Summary collapse

Instance Method Details

#delete(path = '/files/', params = {}) ⇒ Object

request with DELETE verb


34
35
36
# File 'lib/uploadcare/api/raw_api.rb', line 34

def delete(path = '/files/', params = {})
  request :delete, path, params
end

#get(path = '/files/', params = {}) ⇒ Object

request with GET verb


19
20
21
# File 'lib/uploadcare/api/raw_api.rb', line 19

def get(path = '/files/', params = {})
  request :get, path, params
end

#initialize(options = {}) ⇒ Object


5
6
7
8
9
# File 'lib/uploadcare/api/raw_api.rb', line 5

def initialize(options = {})
  @options = Uploadcare::default_settings.merge(options)
  @api_connection = Uploadcare::Connections::ApiConnection.new(@options)
  @upload_connection = Uploadcare::Connections::UploadConnection.new(@options)
end

#post(path = '/files/', params = {}) ⇒ Object

request with POST verb


24
25
26
# File 'lib/uploadcare/api/raw_api.rb', line 24

def post(path = '/files/', params = {})
  request :post, path, params
end

#put(path = '/files/', params = {}) ⇒ Object

request with PUT verb


29
30
31
# File 'lib/uploadcare/api/raw_api.rb', line 29

def put(path = '/files/', params = {})
  request :put, path, params
end

#request(method = :get, path = '/files/', params = {}) ⇒ Object Also known as: api_request

basic request method


12
13
14
15
# File 'lib/uploadcare/api/raw_api.rb', line 12

def request(method = :get, path = '/files/', params = {})
  response = @api_connection.send method, path, params
  response.body
end