class TingYun::Http::ExconHTTPResponse
Public Class Methods
new(response)
click to toggle source
# File lib/ting_yun/http/excon_wrappers.rb, line 9 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/ting_yun/http/excon_wrappers.rb, line 21 def [](key) @normalized_headers[key.upcase] end
to_hash()
click to toggle source
# File lib/ting_yun/http/excon_wrappers.rb, line 25 def to_hash @normalized_headers.dup end