Object
# File lib/typhoeus/response.rb, line 9 9: def initialize(params = {}) 10: @code = params[:code] 11: @headers = params[:headers] 12: @body = params[:body] 13: @time = params[:time] 14: @requested_url = params[:requested_url] 15: @requested_http_method = params[:requested_http_method] 16: @start_time = params[:start_time] 17: @request = params[:request] 18: @effective_url = params[:effective_url] 19: end
# File lib/typhoeus/response.rb, line 21 21: def headers_hash 22: headers.split("\n").map {|o| o.strip}.inject({}) do |hash, o| 23: if o.empty? 24: hash 25: else 26: i = o.index(":") || o.size 27: key = o.slice(0, i) 28: value = o.slice(i + 1, o.size) 29: value = value.strip unless value.nil? 30: if hash.has_key? key 31: hash[key] = [hash[key], value].flatten 32: else 33: hash[key] = value 34: end 35: 36: hash 37: end 38: end 39: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.