Class: Tide::API::HTTPClient Private
- Inherits:
-
Object
- Object
- Tide::API::HTTPClient
- Defined in:
- lib/tide/api/http_client.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for the HTTP interactions. The only entity aware of HTTP concerns such as status codes and headers.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
private
An OAuth2 access token.
-
#refresh_token ⇒ Object
private
An OAuth2 refresh token.
Instance Method Summary collapse
-
#get(endpoint) ⇒ Response
private
Performs a GET request to Tide’s API.
Instance Attribute Details
#access_token ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
An OAuth2 access token
12 13 14 |
# File 'lib/tide/api/http_client.rb', line 12 def access_token @access_token end |
#refresh_token ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
An OAuth2 refresh token
15 16 17 |
# File 'lib/tide/api/http_client.rb', line 15 def refresh_token @refresh_token end |
Instance Method Details
#get(endpoint) ⇒ Response
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Performs a GET request to Tide’s API. Every request returns the status code 200.
27 28 29 30 31 |
# File 'lib/tide/api/http_client.rb', line 27 def get(endpoint) response = HTTP.headers(headers).get(endpoint) Response.new(JSON.parse(response.body), response.status != 200) end |