Class: Async::WebSocket::UpgradeRequest::Wrapper
- Inherits:
-
Object
- Object
- Async::WebSocket::UpgradeRequest::Wrapper
- Defined in:
- lib/async/websocket/upgrade_request.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
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 Attribute Details
#response ⇒ Object
Returns the value of attribute response.
45 46 47 |
# File 'lib/async/websocket/upgrade_request.rb', line 45 def response @response end |
Instance Method Details
#body ⇒ Object
63 64 65 |
# File 'lib/async/websocket/upgrade_request.rb', line 63 def body nil end |
#body? ⇒ Boolean
59 60 61 |
# File 'lib/async/websocket/upgrade_request.rb', line 59 def body? false end |
#headers ⇒ Object
55 56 57 |
# File 'lib/async/websocket/upgrade_request.rb', line 55 def headers @response.headers end |
#protocol ⇒ Object
67 68 69 |
# File 'lib/async/websocket/upgrade_request.rb', line 67 def protocol @response.protocol end |
#status ⇒ Object
51 52 53 |
# File 'lib/async/websocket/upgrade_request.rb', line 51 def status @response.status end |
#stream ⇒ Object
71 72 73 |
# File 'lib/async/websocket/upgrade_request.rb', line 71 def stream @stream ||= @response.hijack! end |
#stream? ⇒ Boolean
47 48 49 |
# File 'lib/async/websocket/upgrade_request.rb', line 47 def stream? @response.status == 101 end |