Class: Flash
- Inherits:
-
Object
- Object
- Flash
- Defined in:
- lib/scaffold/lib/controller/cookies/flash.rb
Instance Attribute Summary collapse
-
#now ⇒ Object
readonly
Returns the value of attribute now.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(req) ⇒ Flash
constructor
A new instance of Flash.
- #store_flash(res) ⇒ Object
Constructor Details
Instance Attribute Details
#now ⇒ Object (readonly)
Returns the value of attribute now.
5 6 7 |
# File 'lib/scaffold/lib/controller/cookies/flash.rb', line 5 def now @now end |
Instance Method Details
#[](key) ⇒ Object
18 19 20 |
# File 'lib/scaffold/lib/controller/cookies/flash.rb', line 18 def [](key) now[key.to_s] || [key.to_s] end |
#[]=(key, val) ⇒ Object
22 23 24 |
# File 'lib/scaffold/lib/controller/cookies/flash.rb', line 22 def []=(key, val) [key.to_s] = val end |
#store_flash(res) ⇒ Object
26 27 28 29 |
# File 'lib/scaffold/lib/controller/cookies/flash.rb', line 26 def store_flash(res) = { path: '/', value: JSON.generate() } res.('_rails_lite_app_flash', ) end |