Class: Foam::Otel::IsolatedHttpClient::Response

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



61
62
63
# File 'lib/foam/otel/isolated_http_client.rb', line 61

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



61
62
63
# File 'lib/foam/otel/isolated_http_client.rb', line 61

def code
  @code
end

#headersObject (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]