Class: Async::HTTP::Protocol::HTTP1::Response
- Inherits:
-
Response
- Object
- Protocol::HTTP::Response
- Response
- Async::HTTP::Protocol::HTTP1::Response
show all
- Defined in:
- lib/async/http/protocol/http1/response.rb
Constant Summary
collapse
- UPGRADE =
'upgrade'
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Response
#peer, #remote_address, #remote_address=
Constructor Details
#initialize(connection, version, status, reason, headers, body) ⇒ Response
Returns a new instance of Response.
39
40
41
42
43
44
45
|
# File 'lib/async/http/protocol/http1/response.rb', line 39
def initialize(connection, version, status, reason, , body)
@connection = connection
protocol = .delete(UPGRADE)
super(version, status, , body, protocol)
end
|
Class Method Details
.read(connection, request) ⇒ Object
30
31
32
33
34
|
# File 'lib/async/http/protocol/http1/response.rb', line 30
def self.read(connection, request)
if parts = connection.read_response(request.method)
self.new(connection, *parts)
end
end
|
Instance Method Details
#connection ⇒ Object
47
48
49
|
# File 'lib/async/http/protocol/http1/response.rb', line 47
def connection
@connection
end
|
#hijack! ⇒ Object
55
56
57
|
# File 'lib/async/http/protocol/http1/response.rb', line 55
def hijack!
@connection.hijack!
end
|
#hijack? ⇒ Boolean
51
52
53
|
# File 'lib/async/http/protocol/http1/response.rb', line 51
def hijack?
@body.nil?
end
|