Class: NewRelic::Manticore::WrappedResponse

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



4
5
6
# File 'lib/new_relic/manticore/wrapped_response.rb', line 4

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

Instance Method Details

#[](key) ⇒ Object



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

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

#to_hashObject



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

def to_hash
  @headers
end