class OneApm::Support::HTTPClients::TyphoeusHTTPResponse

Public Class Methods

new(response) click to toggle source
# File lib/one_apm/support/http_clients/typhoeus_wrappers.rb, line 7
def initialize(response)
  @response = response
end

Public Instance Methods

[](key) click to toggle source
# File lib/one_apm/support/http_clients/typhoeus_wrappers.rb, line 11
def [](key)
  unless headers.nil?
    result = headers[key]

    # Typhoeus 0.5.3 has a bug where asking the headers hash for a
    # non-existent header will return the hash itself, not what we want.
    result == headers ? nil : result
  end
end
to_hash() click to toggle source
# File lib/one_apm/support/http_clients/typhoeus_wrappers.rb, line 21
def to_hash
  hash = {}
  headers.each do |(k,v)|
    hash[k] = v
  end
  hash
end

Private Instance Methods

headers() click to toggle source
# File lib/one_apm/support/http_clients/typhoeus_wrappers.rb, line 31
def headers
  @response.headers
end