Module: Datadog::Core::Transport::HTTP::Response
- Included in:
- Remote::Transport::HTTP::Config::Response, Remote::Transport::HTTP::Negotiation::Response, Tracing::Transport::HTTP::Traces::Response
- Defined in:
- lib/datadog/core/transport/http/response.rb
Overview
Wraps an HTTP response from an adapter.
Used by endpoints to wrap responses from adapters with fields or behavior that’s specific to that endpoint.
Instance Method Summary collapse
- #client_error? ⇒ Boolean
- #code ⇒ Object
- #initialize(http_response) ⇒ Object
- #internal_error? ⇒ Boolean
- #not_found? ⇒ Boolean
- #ok? ⇒ Boolean
- #payload ⇒ Object
- #server_error? ⇒ Boolean
- #unsupported? ⇒ Boolean
Instance Method Details
#client_error? ⇒ Boolean
44 45 46 |
# File 'lib/datadog/core/transport/http/response.rb', line 44 def client_error? @http_response.client_error? end |
#code ⇒ Object
53 54 55 |
# File 'lib/datadog/core/transport/http/response.rb', line 53 def code @http_response.respond_to?(:code) ? @http_response.code : nil end |
#initialize(http_response) ⇒ Object
14 15 16 |
# File 'lib/datadog/core/transport/http/response.rb', line 14 def initialize(http_response) @http_response = http_response end |
#internal_error? ⇒ Boolean
24 25 26 |
# File 'lib/datadog/core/transport/http/response.rb', line 24 def internal_error? @http_response.internal_error? end |
#not_found? ⇒ Boolean
39 40 41 |
# File 'lib/datadog/core/transport/http/response.rb', line 39 def not_found? @http_response.not_found? end |
#ok? ⇒ Boolean
34 35 36 |
# File 'lib/datadog/core/transport/http/response.rb', line 34 def ok? @http_response.ok? end |
#payload ⇒ Object
19 20 21 |
# File 'lib/datadog/core/transport/http/response.rb', line 19 def payload @http_response.payload end |
#server_error? ⇒ Boolean
49 50 51 |
# File 'lib/datadog/core/transport/http/response.rb', line 49 def server_error? @http_response.server_error? end |
#unsupported? ⇒ Boolean
29 30 31 |
# File 'lib/datadog/core/transport/http/response.rb', line 29 def unsupported? @http_response.unsupported? end |