class NewRelic::Agent::HTTPClients::ExconHTTPResponse
Public Class Methods
new(response)
click to toggle source
# File lib/new_relic/agent/http_clients/excon_wrappers.rb, line 8 def initialize(response) @response = response # Since HTTP headers are case-insensitive, we normalize all of them to # upper case here, and then also in our [](key) implementation. @normalized_headers = {} headers = response.respond_to?(:headers) ? response.headers : response[:headers] (headers || {}).each do |key, val| @normalized_headers[key.upcase] = val end end
Public Instance Methods
[](key)
click to toggle source
# File lib/new_relic/agent/http_clients/excon_wrappers.rb, line 19 def [](key) @normalized_headers[key.upcase] end
to_hash()
click to toggle source
# File lib/new_relic/agent/http_clients/excon_wrappers.rb, line 23 def to_hash @normalized_headers.dup end