Class: CobotClient::ApiClient

Inherits:
Object
  • Object
show all
Includes:
UrlHelper
Defined in:
lib/cobot_client/api_client.rb

Constant Summary

Constants included from UrlHelper

UrlHelper::DEFAULT_SITE

Class Attribute Summary collapse

Instance Method Summary collapse

Methods included from UrlHelper

#cobot_uri, #cobot_url, site, site=

Constructor Details

#initialize(access_token) ⇒ ApiClient

Returns a new instance of ApiClient.



13
14
15
# File 'lib/cobot_client/api_client.rb', line 13

def initialize(access_token)
  @access_token = access_token
end

Class Attribute Details

.retry_timeObject

Returns the value of attribute retry_time.



8
9
10
# File 'lib/cobot_client/api_client.rb', line 8

def retry_time
  @retry_time
end

.user_agentObject

Returns the value of attribute user_agent.



8
9
10
# File 'lib/cobot_client/api_client.rb', line 8

def user_agent
  @user_agent
end

Instance Method Details

#deleteObject

args: either a full URL or subdomain, path



37
38
39
# File 'lib/cobot_client/api_client.rb', line 37

def delete(*)
  request(:delete, *)
end

#getObject

args: either a full URL or subdomain, path, plus an optional params hash



32
33
34
# File 'lib/cobot_client/api_client.rb', line 32

def get(*)
  request(:get, *).parsed_body
end

#patchObject



27
28
29
# File 'lib/cobot_client/api_client.rb', line 27

def patch(*)
  request(:patch, *).parsed_body
end

#postObject

args: either a full URL or subdomain, path, plus a body as hash



18
19
20
# File 'lib/cobot_client/api_client.rb', line 18

def post(*)
  request(:post, *).parsed_body
end

#putObject

args: either a full URL or subdomain, path, plus a body as hash



23
24
25
# File 'lib/cobot_client/api_client.rb', line 23

def put(*)
  request(:put, *).parsed_body
end