class Mmtrix::Agent::HTTPClients::TyphoeusHTTPResponse

Public Class Methods

new(response) click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 9
def initialize(response)
  @response = response
end

Public Instance Methods

[](key) click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 13
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/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 23
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/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 33
def headers
  @response.headers
end