Class: Wands::HTTPResponse
- Inherits:
-
Object
- Object
- Wands::HTTPResponse
- Defined in:
- lib/wands/http_response.rb
Overview
Example usage:
response = HTTPResponse.new response.parse(socket) response.header # => [“websocket”] response.header # => [“Upgrade”] response.header # => [“s3pPLMBiTxaQ9kYGzzhZRbK+xOo=”]
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
26 27 28 |
# File 'lib/wands/http_response.rb', line 26 def header @header end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
26 27 28 |
# File 'lib/wands/http_response.rb', line 26 def status @status end |
Instance Method Details
#parse(stream) ⇒ Object
28 29 30 31 |
# File 'lib/wands/http_response.rb', line 28 def parse(stream) @response = read_from stream @status, @header = headers_of @response end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/wands/http_response.rb', line 33 def to_s @response end |