Class: Userbin::SessionStore::Rack
- Inherits:
-
Userbin::SessionStore
- Object
- Userbin::SessionStore
- Userbin::SessionStore::Rack
- Defined in:
- lib/userbin/session_store.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(session) ⇒ Rack
constructor
A new instance of Rack.
- #read ⇒ Object
- #user_id ⇒ Object
- #user_id=(value) ⇒ Object
- #write(value) ⇒ Object
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
#destroy ⇒ Object
24 25 26 |
# File 'lib/userbin/session_store.rb', line 24 def destroy @session.delete(key) end |
#read ⇒ Object
16 17 18 |
# File 'lib/userbin/session_store.rb', line 16 def read @session[key] end |
#user_id ⇒ Object
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 |