Class: HTTY::Response
Overview
Encapsulates an HTTP(S) response.
Constant Summary
- COOKIES_HEADER_NAME =
'Set-Cookie'- LOCATION_HEADER_NAME =
'Location'
Instance Attribute Summary (collapse)
-
- (Object) status
readonly
Returns the HTTP status associated with the response.
Attributes inherited from Payload
Instance Method Summary (collapse)
-
- (Object) cookies
Returns an array of the cookies belonging to the response.
-
- (Response) initialize(attributes = {})
constructor
Initializes a new HTTY::Response with attribute values specified in the attributes hash.
Methods inherited from Payload
Constructor Details
- (Response) initialize(attributes = {})
Initializes a new HTTY::Response with attribute values specified in the attributes hash.
Valid attributes keys include:
-
:body
-
:headers
-
:status
23 24 25 26 |
# File 'lib/htty/response.rb', line 23 def initialize(attributes={}) super attributes @status = attributes[:status] end |
Instance Attribute Details
- (Object) status (readonly)
Returns the HTTP status associated with the response.
13 14 15 |
# File 'lib/htty/response.rb', line 13 def status @status end |
Instance Method Details
- (Object) cookies
Returns an array of the cookies belonging to the response.
29 30 31 |
# File 'lib/htty/response.rb', line 29 def HTTY::CookiesUtil. @headers[COOKIES_HEADER_NAME] end |