Class: Celluloid::WebSocket::DriverEnvironment
- Inherits:
-
Object
- Object
- Celluloid::WebSocket::DriverEnvironment
- Extended by:
- Forwardable
- Defined in:
- lib/celluloid/websocket.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(env, socket) ⇒ DriverEnvironment
constructor
A new instance of DriverEnvironment.
Constructor Details
#initialize(env, socket) ⇒ DriverEnvironment
Returns a new instance of DriverEnvironment.
77 78 79 80 81 82 83 84 85 |
# File 'lib/celluloid/websocket.rb', line 77 def initialize(env, socket) @env = env secure = ::Rack::Request.new(env).ssl? scheme = secure ? 'wss:' : 'ws:' @url = scheme + '//' + env['HTTP_HOST'] + env['REQUEST_URI'] @socket = socket end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
73 74 75 |
# File 'lib/celluloid/websocket.rb', line 73 def env @env end |
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
73 74 75 |
# File 'lib/celluloid/websocket.rb', line 73 def socket @socket end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
73 74 75 |
# File 'lib/celluloid/websocket.rb', line 73 def url @url end |