Class: MoonropeClient::Response
- Inherits:
-
Object
- Object
- MoonropeClient::Response
- Defined in:
- lib/moonrope_client/response.rb
Direct Known Subclasses
MoonropeClient::Responses::AccessDenied, MoonropeClient::Responses::ParameterError, MoonropeClient::Responses::Success, MoonropeClient::Responses::ValidationError
Instance Method Summary collapse
-
#data ⇒ Object
The data returned by the server.
-
#exception_message ⇒ Object
@return [Strig] the string for representing this response in an exception.
-
#flags ⇒ Hash
Any flags returned by the server.
-
#initialize(request, data) ⇒ Response
constructor
Initialize a new response object.
-
#status ⇒ String
The status of the request returned by the server.
-
#success? ⇒ Boolean
Is this a successful response?.
-
#time ⇒ Float
The time the request took at the server.
Constructor Details
#initialize(request, data) ⇒ Response
Initialize a new response object
10 11 12 13 |
# File 'lib/moonrope_client/response.rb', line 10 def initialize(request, data) @request = request @data = data end |
Instance Method Details
#data ⇒ Object
Returns the data returned by the server.
40 41 42 |
# File 'lib/moonrope_client/response.rb', line 40 def data @data['data'] end |
#exception_message ⇒ Object
@return [Strig] the string for representing this response in an exception
54 55 56 |
# File 'lib/moonrope_client/response.rb', line 54 def self.data end |
#flags ⇒ Hash
Returns any flags returned by the server.
33 34 35 |
# File 'lib/moonrope_client/response.rb', line 33 def flags @data['flags'] end |
#status ⇒ String
Returns the status of the request returned by the server.
27 28 29 |
# File 'lib/moonrope_client/response.rb', line 27 def status @data['status'] end |
#success? ⇒ Boolean
Is this a successful response?
20 21 22 |
# File 'lib/moonrope_client/response.rb', line 20 def success? false end |
#time ⇒ Float
Returns the time the request took at the server.
47 48 49 |
# File 'lib/moonrope_client/response.rb', line 47 def time @data['time'] end |