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(socket) ⇒ Object
-
#initialize ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize ⇒ Response
5 6 7 |
# File 'lib/reifier/response.rb', line 5 def initialize @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
18 19 20 21 22 |
# File 'lib/reifier/response.rb', line 18 def <<(rack_return) @status = rack_return[0] @headers = rack_return[1] @body = rack_return[2] end |
#handle(socket) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/reifier/response.rb', line 9 def handle(socket) handle_request_line handle_headers handle_body socket.write @response socket.close end |