Class: Async::WebSocket::ConnectRequest::Wrapper
- Inherits:
-
Object
- Object
- Async::WebSocket::ConnectRequest::Wrapper
- Defined in:
- lib/async/websocket/connect_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
- #body? ⇒ Boolean
- #headers ⇒ Object
-
#initialize(body, response) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #protocol ⇒ Object
- #status ⇒ Object
- #stream ⇒ Object
- #stream? ⇒ Boolean
Constructor Details
#initialize(body, response) ⇒ Wrapper
Returns a new instance of Wrapper.
35 36 37 38 39 |
# File 'lib/async/websocket/connect_request.rb', line 35 def initialize(body, response) @body = body @response = response @stream = nil end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
57 58 59 |
# File 'lib/async/websocket/connect_request.rb', line 57 def body @body end |
Instance Method Details
#body? ⇒ Boolean
53 54 55 |
# File 'lib/async/websocket/connect_request.rb', line 53 def body? true end |
#headers ⇒ Object
49 50 51 |
# File 'lib/async/websocket/connect_request.rb', line 49 def headers @response.headers end |
#protocol ⇒ Object
59 60 61 |
# File 'lib/async/websocket/connect_request.rb', line 59 def protocol @response.protocol end |
#status ⇒ Object
45 46 47 |
# File 'lib/async/websocket/connect_request.rb', line 45 def status @response.status end |
#stream ⇒ Object
63 64 65 |
# File 'lib/async/websocket/connect_request.rb', line 63 def stream @stream ||= Async::HTTP::Body::Stream.new(@response.body, @body) end |
#stream? ⇒ Boolean
41 42 43 |
# File 'lib/async/websocket/connect_request.rb', line 41 def stream? @response.success? end |