class TingYun::Http::TyphoeusHTTPResponse

Public Class Methods

new(response) click to toggle source
# File lib/ting_yun/http/typhoeus_wrappers.rb, line 8
def initialize(response)
  @response = response
end

Public Instance Methods

[](key) click to toggle source
# File lib/ting_yun/http/typhoeus_wrappers.rb, line 12
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/ting_yun/http/typhoeus_wrappers.rb, line 22
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/ting_yun/http/typhoeus_wrappers.rb, line 32
def headers
  @response.headers
end