Class: Async::WebSocket::UpgradeRequest::Wrapper
- Inherits:
-
Object
- Object
- Async::WebSocket::UpgradeRequest::Wrapper
- Defined in:
- lib/async/websocket/upgrade_request.rb
Instance Method Summary collapse
- #body ⇒ Object
- #body? ⇒ Boolean
- #headers ⇒ Object
-
#initialize(response) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #protocol ⇒ Object
- #status ⇒ Object
- #stream ⇒ Object
- #stream? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Wrapper
Returns a new instance of Wrapper.
40 41 42 43 |
# File 'lib/async/websocket/upgrade_request.rb', line 40 def initialize(response) @response = response @stream = nil end |
Instance Method Details
#body ⇒ Object
61 62 63 |
# File 'lib/async/websocket/upgrade_request.rb', line 61 def body nil end |
#body? ⇒ Boolean
57 58 59 |
# File 'lib/async/websocket/upgrade_request.rb', line 57 def body? false end |
#headers ⇒ Object
53 54 55 |
# File 'lib/async/websocket/upgrade_request.rb', line 53 def headers @response.headers end |
#protocol ⇒ Object
65 66 67 |
# File 'lib/async/websocket/upgrade_request.rb', line 65 def protocol @response.protocol end |
#status ⇒ Object
49 50 51 |
# File 'lib/async/websocket/upgrade_request.rb', line 49 def status @response.status end |
#stream ⇒ Object
69 70 71 |
# File 'lib/async/websocket/upgrade_request.rb', line 69 def stream @stream ||= @response.hijack! end |
#stream? ⇒ Boolean
45 46 47 |
# File 'lib/async/websocket/upgrade_request.rb', line 45 def stream? @response.status == 101 end |