Class: NewRelicHTTP::HTTPResponse
- Inherits:
-
Object
- Object
- NewRelicHTTP::HTTPResponse
- Defined in:
- lib/newrelic_httprb/wrappers.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(response) ⇒ HTTPResponse
constructor
A new instance of HTTPResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize(response) ⇒ HTTPResponse
Returns a new instance of HTTPResponse.
5 6 7 |
# File 'lib/newrelic_httprb/wrappers.rb', line 5 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/newrelic_httprb/wrappers.rb', line 3 def response @response end |
Instance Method Details
#[](key) ⇒ Object
9 10 11 12 |
# File 'lib/newrelic_httprb/wrappers.rb', line 9 def [](key) _, value = response.headers.find { |k,_| key.downcase == k.downcase } value unless value.nil? end |
#to_hash ⇒ Object
14 15 16 |
# File 'lib/newrelic_httprb/wrappers.rb', line 14 def to_hash response.headers end |