Class: Foam::Otel::IsolatedHttpClient::Response
- Inherits:
-
Object
- Object
- Foam::Otel::IsolatedHttpClient::Response
- Defined in:
- lib/foam/otel/isolated_http_client.rb
Overview
A plain value response — code (Integer), lowercased header Hash, body (String). Not a Net::HTTPResponse: response handling must not touch patchable Net::* classes either.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(code, headers, body) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(code, headers, body) ⇒ Response
Returns a new instance of Response.
63 64 65 66 67 |
# File 'lib/foam/otel/isolated_http_client.rb', line 63 def initialize(code, headers, body) @code = code @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
61 62 63 |
# File 'lib/foam/otel/isolated_http_client.rb', line 61 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
61 62 63 |
# File 'lib/foam/otel/isolated_http_client.rb', line 61 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
61 62 63 |
# File 'lib/foam/otel/isolated_http_client.rb', line 61 def headers @headers end |
Instance Method Details
#[](name) ⇒ Object
69 |
# File 'lib/foam/otel/isolated_http_client.rb', line 69 def [](name) = @headers[name.to_s.downcase] |