Class: Patron::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/patron/response.rb

Overview

Represents the response from the HTTP server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



31
32
33
# File 'lib/patron/response.rb', line 31

def initialize
  @headers = {}
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



35
36
37
# File 'lib/patron/response.rb', line 35

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



35
36
37
# File 'lib/patron/response.rb', line 35

def headers
  @headers
end

#redirect_countObject (readonly)

Returns the value of attribute redirect_count.



35
36
37
# File 'lib/patron/response.rb', line 35

def redirect_count
  @redirect_count
end

#statusObject (readonly)

Returns the value of attribute status.



35
36
37
# File 'lib/patron/response.rb', line 35

def status
  @status
end

#status_lineObject (readonly)

Returns the value of attribute status_line.



35
36
37
# File 'lib/patron/response.rb', line 35

def status_line
  @status_line
end

#urlObject (readonly)

Returns the value of attribute url.



35
36
37
# File 'lib/patron/response.rb', line 35

def url
  @url
end

Instance Method Details

#inspectObject



37
38
39
40
# File 'lib/patron/response.rb', line 37

def inspect
  # Avoid spamming the console with the header and body data
  "#<Patron::Response @status_line='#{@status_line}'>"
end