Class: Userbin::SessionStore::Rack

Inherits:
Userbin::SessionStore show all
Defined in:
lib/userbin/session_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ Rack

Returns a new instance of Rack.



4
5
6
# File 'lib/userbin/session_store.rb', line 4

def initialize(session)
  @session = session
end

Instance Method Details

#destroyObject



24
25
26
# File 'lib/userbin/session_store.rb', line 24

def destroy
  @session.delete(key)
end

#readObject



16
17
18
# File 'lib/userbin/session_store.rb', line 16

def read
  @session[key]
end

#user_idObject



8
9
10
# File 'lib/userbin/session_store.rb', line 8

def user_id
  @session['userbin.user_id']
end

#user_id=(value) ⇒ Object



12
13
14
# File 'lib/userbin/session_store.rb', line 12

def user_id=(value)
  @session['userbin.user_id'] = value
end

#write(value) ⇒ Object



20
21
22
# File 'lib/userbin/session_store.rb', line 20

def write(value)
  @session[key] = value
end