Class: Sumo::Client
Overview
This class has the lowest-level interface to interact with the Sumo Job API.
Constant Summary collapse
- REDIRECT_STATUSES =
[301, 302, 303, 307, 308]
- DEFAULT_ERROR_MESSAGE =
The error message raised when the result can be parsed from Sumo.
'Error sending API request'
Instance Attribute Summary collapse
-
#cookie ⇒ Object
readonly
Returns the value of attribute cookie.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Instance Method Summary collapse
-
#initialize(credentials = Sumo.creds) ⇒ Client
constructor
Create a new ‘Sumo::Client` with the given credentials.
-
#request(hash, &block) ⇒ Object
Send a request to the API and retrieve processed data.
Constructor Details
Instance Attribute Details
#cookie ⇒ Object (readonly)
Returns the value of attribute cookie.
5 6 7 |
# File 'lib/sumo/client.rb', line 5 def @cookie end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
5 6 7 |
# File 'lib/sumo/client.rb', line 5 def email @email end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/sumo/client.rb', line 5 def password @password end |
Instance Method Details
#request(hash, &block) ⇒ Object
Send a request to the API and retrieve processed data.
19 20 21 |
# File 'lib/sumo/client.rb', line 19 def request(hash, &block) handle_request(hash, &block).body end |