Parent

Rufus::Jig::HttpResponse

Attributes

status[R]
headers[R]
body[R]
original[R]

Public Class Methods

new( em_client ) click to toggle source
    # File lib/rufus/jig/adapters/em.rb, line 28
28:   def initialize( em_client )
29: 
30:     @original = [ em_client, em_client.response ]
31: 
32:     @status = em_client.response_header.status
33:     @headers = response_headers( em_client.response_header )
34:     @body = em_client.response
35:   end
new(patron_res) click to toggle source
    # File lib/rufus/jig/adapters/patron.rb, line 28
28:   def initialize (patron_res)
29: 
30:     @original = patron_res
31:     @status = patron_res.status
32:     @headers = patron_res.headers
33:     @body = patron_res.body
34:   end
new(nh_res) click to toggle source
    # File lib/rufus/jig/adapters/net.rb, line 31
31:   def initialize (nh_res)
32: 
33:     @original = nh_res
34:     @status = nh_res.code.to_i
35:     @body = nh_res.body
36:     @headers = {}
37:     nh_res.each { |k, v|
38:       @headers[k.split('-').collect { |s| s.capitalize }.join('-')] = v
39:     }
40:   end

Protected Instance Methods

response_headers( hash ) click to toggle source
    # File lib/rufus/jig/adapters/em.rb, line 39
39:   def response_headers( hash )
40: 
41:     hash.inject({}) do |headers, ( key, value )|
42:       key = key.downcase.split('_').map { |c| c.capitalize }.join( '-' )
43:       headers[ key ] = value
44:       headers
45:     end
46:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.