Class: CobotClient::ApiClient
- Inherits:
-
Object
- Object
- CobotClient::ApiClient
- Includes:
- UrlHelper
- Defined in:
- lib/cobot_client/api_client.rb
Constant Summary
Constants included from UrlHelper
Class Attribute Summary collapse
-
.retry_time ⇒ Object
Returns the value of attribute retry_time.
-
.user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#delete ⇒ Object
args: either a full URL or subdomain, path.
-
#get ⇒ Object
args: either a full URL or subdomain, path, plus an optional params hash.
-
#initialize(access_token) ⇒ ApiClient
constructor
A new instance of ApiClient.
- #patch ⇒ Object
-
#post ⇒ Object
args: either a full URL or subdomain, path, plus a body as hash.
-
#put ⇒ Object
args: either a full URL or subdomain, path, plus a body as hash.
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_time ⇒ Object
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_agent ⇒ Object
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
#delete ⇒ Object
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 |
#get ⇒ Object
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 |
#patch ⇒ Object
27 28 29 |
# File 'lib/cobot_client/api_client.rb', line 27 def patch(*) request(:patch, *).parsed_body end |
#post ⇒ Object
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 |
#put ⇒ Object
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 |