Module: Close::APIOperations

Included in:
APIResource, Filter
Defined in:
lib/close/api_operations.rb

Instance Method Summary collapse

Instance Method Details

#request(method, path, params = {}, opts = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/close/api_operations.rb', line 4

def request(method, path, params = {}, opts = {})
  preflight_request(method, path, params, opts)

  case method
  when :get
    response = get(path, params, opts)
  when :post
    response = post(path, params, opts)
  when :put
    response = put(path, params, opts)
  when :delete
    response = delete(path, params, opts)
  end
  
  handle_response(response)
end