Parent

Typhoeus::Response

Attributes

request[RW]
code[R]
headers[R]
body[R]
time[R]
requested_url[R]
requested_remote_method[R]
requested_http_method[R]
start_time[R]
effective_url[R]

Public Class Methods

new(params = {}) click to toggle source
    # 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

Public Instance Methods

headers_hash() click to toggle source
    # 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
modified?() click to toggle source
    # File lib/typhoeus/response.rb, line 45
45:     def modified?
46:       @code != 304
47:     end
success?() click to toggle source
    # File lib/typhoeus/response.rb, line 41
41:     def success?
42:       @code >= 200 && @code < 300
43:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.