Class: NewRelic::Manticore::WrappedResponse

Inherits:
Agent::HTTPClients::AbstractResponse
  • Object
show all
Defined in:
lib/new_relic/manticore/wrapped_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ WrappedResponse

Returns a new instance of WrappedResponse.



8
9
10
11
# File 'lib/new_relic/manticore/wrapped_response.rb', line 8

def initialize(response)
  super(response)
  @headers = response.headers
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
16
# File 'lib/new_relic/manticore/wrapped_response.rb', line 13

def [](key)
  _, value = @headers.find { |k, _| k.casecmp(key).zero? }
  value
end

#to_hashObject



18
19
20
# File 'lib/new_relic/manticore/wrapped_response.rb', line 18

def to_hash
  @headers
end