Class: Momento::Response
- Inherits:
-
Object
- Object
- Momento::Response
- Defined in:
- lib/momento/response.rb,
lib/momento/response/error.rb
Overview
The response from a Momento service request.
SimpleCacheClient returns a response for both success and error, as well as other states. See the documenation for each type of response for more.
You can always check for an error response with ‘response.error?` and get the error itself with `response.error`.
‘response.error` is an Exception and can be raised. It contains additional information about the error, see Error for more information.
Direct Known Subclasses
CreateCacheResponse, DeleteCacheResponse, DeleteResponse, GetResponse, ListCachesResponse, SetResponse
Instance Method Summary collapse
-
#error ⇒ Momento::Error?
Returns the error portion of the response, if any.
-
#error? ⇒ Boolean
Is the response an error?.
-
#to_s ⇒ String
Displays the type of response and additional info, if any.
Instance Method Details
#error ⇒ Momento::Error?
Returns the error portion of the response, if any.
43 44 45 |
# File 'lib/momento/response.rb', line 43 def error nil end |
#error? ⇒ Boolean
Is the response an error?
50 51 52 |
# File 'lib/momento/response.rb', line 50 def error? false end |
#to_s ⇒ String
Displays the type of response and additional info, if any.
56 57 58 |
# File 'lib/momento/response.rb', line 56 def to_s self.class.to_s end |