Class: Flash
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(req) ⇒ Flash
constructor
A new instance of Flash.
- #now ⇒ Object
- #store_flash(res) ⇒ Object
Constructor Details
#initialize(req) ⇒ Flash
Returns a new instance of Flash.
2 3 4 5 6 7 8 |
# File 'lib/actioncondor/flash.rb', line 2 def initialize(req) @flash = {} = req.['_gazebo_app_flash'] @flash_now = ? JSON.parse() : {} end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/actioncondor/flash.rb', line 14 def [](key) @flash[key.to_s] || @flash_now[key.to_s] || @flash_now[key] end |
#[]=(key, val) ⇒ Object
18 19 20 |
# File 'lib/actioncondor/flash.rb', line 18 def []=(key, val) @flash[key.to_s] = val end |
#now ⇒ Object
10 11 12 |
# File 'lib/actioncondor/flash.rb', line 10 def now @flash_now end |
#store_flash(res) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/actioncondor/flash.rb', line 22 def store_flash(res) res.( '_gazebo_app_flash', path: '/', value: @flash.to_json ) end |