Class: Session
Instance Attribute Summary collapse
-
#cookie ⇒ Object
readonly
Returns the value of attribute cookie.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(req) ⇒ Session
constructor
A new instance of Session.
- #store_session(res) ⇒ Object
Constructor Details
permalink #initialize(req) ⇒ Session
Returns a new instance of Session.
4 5 6 7 |
# File 'lib/laris/controller/session.rb', line 4 def initialize(req) = req.['_laris_session'] @cookie = ? JSON.parse() : {} end |
Instance Attribute Details
Instance Method Details
permalink #[](key) ⇒ Object
[View source]
9 10 11 |
# File 'lib/laris/controller/session.rb', line 9 def [](key) [key] end |
permalink #[]=(key, val) ⇒ Object
[View source]
13 14 15 |
# File 'lib/laris/controller/session.rb', line 13 def []=(key, val) [key] = val end |
permalink #store_session(res) ⇒ Object
[View source]
17 18 19 20 |
# File 'lib/laris/controller/session.rb', line 17 def store_session(res) = { path: '/', value: .to_json } res.('_laris_session', ) end |