Class: Wes::Data::API::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/wes/data/api/client.rb

Instance Method Summary collapse

Instance Method Details

#delete(path) ⇒ Object



26
27
28
29
# File 'lib/wes/data/api/client.rb', line 26

def delete(path)
  api_response = time_method(path, 'DELETE') { request.delete(path) }
  response(api_response)
end

#get(path) ⇒ Object



9
10
11
12
# File 'lib/wes/data/api/client.rb', line 9

def get(path)
  api_response = time_method(path, 'GET') { request.get(path) }
  response(api_response)
end

#post(path, options) ⇒ Object



14
15
16
17
18
19
# File 'lib/wes/data/api/client.rb', line 14

def post(path, options)
  api_response = time_method(path, 'POST') do
    request.post(path, options)
  end
  response(api_response)
end

#put(path, options) ⇒ Object



21
22
23
24
# File 'lib/wes/data/api/client.rb', line 21

def put(path, options)
  api_response = time_method(path, 'PUT') { request.put(path, options) }
  response(api_response)
end