Class: Reifier::Response
- Inherits:
-
Object
- Object
- Reifier::Response
- Defined in:
- lib/reifier/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #<<(rack_return) ⇒ Object
- #handle ⇒ Object
-
#initialize(socket) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(socket) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/reifier/response.rb', line 5 def initialize(socket) @socket = socket @response = '' end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/reifier/response.rb', line 3 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/reifier/response.rb', line 3 def headers @headers end |
#protocol ⇒ Object
Returns the value of attribute protocol.
3 4 5 |
# File 'lib/reifier/response.rb', line 3 def protocol @protocol end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/reifier/response.rb', line 3 def status @status end |
Instance Method Details
#<<(rack_return) ⇒ Object
19 20 21 22 23 |
# File 'lib/reifier/response.rb', line 19 def <<(rack_return) @status = rack_return[0] @headers = rack_return[1] @body = rack_return[2] end |
#handle ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/reifier/response.rb', line 10 def handle handle_request_line handle_headers handle_body @socket.write @response @socket.close end |