Class: Alchemrest::Response
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Alchemrest::Response
- Extended by:
- Memosa
- Defined in:
- lib/alchemrest/response.rb,
lib/alchemrest/response/pipeline.rb,
lib/alchemrest/response/pipeline/omit.rb,
lib/alchemrest/response/pipeline/final.rb,
lib/alchemrest/response/pipeline/sanitize.rb,
lib/alchemrest/response/pipeline/transform.rb,
lib/alchemrest/response/pipeline/was_successful.rb,
lib/alchemrest/response/pipeline/extract_payload.rb
Defined Under Namespace
Classes: Pipeline
Instance Method Summary collapse
- #auth_error? ⇒ Boolean
- #circuit_open? ⇒ Boolean
- #client_error? ⇒ Boolean
- #data ⇒ Object
- #error_details ⇒ Object
- #no_content_response? ⇒ Boolean
- #not_found_error? ⇒ Boolean
- #request_failed? ⇒ Boolean
- #server_error? ⇒ Boolean
- #timeout? ⇒ Boolean
- #to_result ⇒ Object
Instance Method Details
#auth_error? ⇒ Boolean
35 36 37 |
# File 'lib/alchemrest/response.rb', line 35 def auth_error? [401, 403].include?(status) end |
#circuit_open? ⇒ Boolean
55 56 57 |
# File 'lib/alchemrest/response.rb', line 55 def circuit_open? false end |
#client_error? ⇒ Boolean
31 32 33 |
# File 'lib/alchemrest/response.rb', line 31 def client_error? (400..499).cover?(status) end |
#data ⇒ Object
10 11 12 |
# File 'lib/alchemrest/response.rb', line 10 def data body end |
#error_details ⇒ Object
23 24 25 |
# File 'lib/alchemrest/response.rb', line 23 def error_details "Error with HTTP status: #{status}" unless success? end |
#no_content_response? ⇒ Boolean
43 44 45 |
# File 'lib/alchemrest/response.rb', line 43 def no_content_response? status == 204 end |
#not_found_error? ⇒ Boolean
39 40 41 |
# File 'lib/alchemrest/response.rb', line 39 def not_found_error? status == 404 end |
#request_failed? ⇒ Boolean
47 48 49 |
# File 'lib/alchemrest/response.rb', line 47 def request_failed? status >= 500 && status <= 599 end |
#server_error? ⇒ Boolean
27 28 29 |
# File 'lib/alchemrest/response.rb', line 27 def server_error? (500..599).cover?(status) end |
#timeout? ⇒ Boolean
51 52 53 |
# File 'lib/alchemrest/response.rb', line 51 def timeout? false end |