Module: SocketIo::Websocket::CarrierWave

Included in:
SocketIo::Websocket
Defined in:
lib/socket.io/websocket/carrier_wave.rb

Constant Summary collapse

@@cache =
{}

Instance Method Summary collapse

Instance Method Details

#init_sessionObject



6
7
8
9
10
11
# File 'lib/socket.io/websocket/carrier_wave.rb', line 6

def init_session
  if session.nil?
    send_connect
    self.session = Time.now
  end
end

#sessionObject



20
21
22
# File 'lib/socket.io/websocket/carrier_wave.rb', line 20

def session
  @@cache[session_key]
end

#session=(cid) ⇒ Object



23
24
25
# File 'lib/socket.io/websocket/carrier_wave.rb', line 23

def session=(cid)
  @@cache[session_key] = cid
end

#session_idObject



13
14
15
# File 'lib/socket.io/websocket/carrier_wave.rb', line 13

def session_id
  params[:session_id]
end

#session_keyObject



17
18
19
# File 'lib/socket.io/websocket/carrier_wave.rb', line 17

def session_key
  'sessions/' + session_id
end