Class: Response
- Inherits:
-
Object
- Object
- Response
- Defined in:
- lib/response.rb
Overview
The Response class is used to represent a set of HTTP response data. Populated instances of this class are serialized to JSON and passed to the GRIP proxy in the body. The GRIP proxy then parses the message and deserialized the JSON into an HTTP response that is passed back to the client.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#reason ⇒ Object
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(code = nil, reason = nil, headers = nil, body = nil) ⇒ Response
constructor
Initialize with an HTTP response code, reason, headers, and body.
Constructor Details
#initialize(code = nil, reason = nil, headers = nil, body = nil) ⇒ Response
Initialize with an HTTP response code, reason, headers, and body.
20 21 22 23 24 25 |
# File 'lib/response.rb', line 20 def initialize(code=nil, reason=nil, headers=nil, body=nil) @code = code @reason = reason @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
17 18 19 |
# File 'lib/response.rb', line 17 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
14 15 16 |
# File 'lib/response.rb', line 14 def code @code end |
#headers ⇒ Object
Returns the value of attribute headers.
16 17 18 |
# File 'lib/response.rb', line 16 def headers @headers end |
#reason ⇒ Object
Returns the value of attribute reason.
15 16 17 |
# File 'lib/response.rb', line 15 def reason @reason end |