Class: OneApm::Support::HTTPClients::HTTPClientResponse
- Inherits:
-
Object
- Object
- OneApm::Support::HTTPClients::HTTPClientResponse
- Defined in:
- lib/one_apm/support/http_clients/httpclient_wrappers.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(response) ⇒ HTTPClientResponse
constructor
A new instance of HTTPClientResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize(response) ⇒ HTTPClientResponse
Returns a new instance of HTTPClientResponse.
9 10 11 |
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 9 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 7 def response @response end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 13 def [](key) response.headers.each do |k,v| if key.downcase == k.downcase return v end end nil end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 22 def to_hash response.headers end |