Class: Patron::Response
- Inherits:
-
Object
- Object
- Patron::Response
- Defined in:
- lib/patron/response.rb
Overview
Represents the response from the HTTP server.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#redirect_count ⇒ Object
readonly
Returns the value of attribute redirect_count.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#status_line ⇒ Object
readonly
Returns the value of attribute status_line.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
31 32 33 |
# File 'lib/patron/response.rb', line 31 def initialize @headers = {} end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def headers @headers end |
#redirect_count ⇒ Object (readonly)
Returns the value of attribute redirect_count.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def redirect_count @redirect_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def status @status end |
#status_line ⇒ Object (readonly)
Returns the value of attribute status_line.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def status_line @status_line end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
35 36 37 |
# File 'lib/patron/response.rb', line 35 def url @url end |
Instance Method Details
#inspect ⇒ Object
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 |