Class: Async::WebSocket::UpgradeRequest::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/async/websocket/upgrade_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject

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

#bodyObject



63
64
65
# File 'lib/async/websocket/upgrade_request.rb', line 63

def body
	nil
end

#body?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/async/websocket/upgrade_request.rb', line 59

def body?
	false
end

#headersObject



55
56
57
# File 'lib/async/websocket/upgrade_request.rb', line 55

def headers
	@response.headers
end

#protocolObject



67
68
69
# File 'lib/async/websocket/upgrade_request.rb', line 67

def protocol
	@response.protocol
end

#statusObject



51
52
53
# File 'lib/async/websocket/upgrade_request.rb', line 51

def status
	@response.status
end

#streamObject



71
72
73
# File 'lib/async/websocket/upgrade_request.rb', line 71

def stream
	@stream ||= @response.hijack!
end

#stream?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/async/websocket/upgrade_request.rb', line 47

def stream?
	@response.status == 101
end