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
#initialize(req) ⇒ Session
Returns a new instance of Session.
4 5 6 7 8 |
# File 'lib/actioncondor/session.rb', line 4 def initialize(req) = req.['_gazebo_app'] @cookie = ? JSON.parse() : {} end |
Instance Attribute Details
#cookie ⇒ Object (readonly)
Returns the value of attribute cookie.
2 3 4 |
# File 'lib/actioncondor/session.rb', line 2 def @cookie end |
Instance Method Details
#[](key) ⇒ Object
10 11 12 |
# File 'lib/actioncondor/session.rb', line 10 def [](key) @cookie[key.to_s] end |
#[]=(key, val) ⇒ Object
14 15 16 |
# File 'lib/actioncondor/session.rb', line 14 def []=(key, val) @cookie[key.to_s] = val end |
#store_session(res) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/actioncondor/session.rb', line 18 def store_session(res) res.( '_gazebo_app', path: '/', value: @cookie.to_json ) end |