Class: Net::PTTH::OutgoingResponse
- Inherits:
-
Struct
- Object
- Struct
- Net::PTTH::OutgoingResponse
- Defined in:
- lib/net/ptth/outgoing_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
2 3 4 |
# File 'lib/net/ptth/outgoing_response.rb', line 2 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers
2 3 4 |
# File 'lib/net/ptth/outgoing_response.rb', line 2 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status
2 3 4 |
# File 'lib/net/ptth/outgoing_response.rb', line 2 def status @status end |
Instance Method Details
#to_s ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/net/ptth/outgoing_response.rb', line 3 def to_s packet = "HTTP/1.1 #{status} OK\n" headers.each { |key, value| packet += "#{key}: #{value}\n" } packet += "\r\n" body.each { |chunk| packet += chunk } packet end |