Class: ActionDispatch::Flash::FlashNow
- Defined in:
- actionpack/lib/action_dispatch/middleware/flash.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#flash ⇒ Object
Returns the value of attribute flash.
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
-
#alert=(message) ⇒ Object
Convenience accessor for
flash.now[:alert]=
. -
#initialize(flash) ⇒ FlashNow
constructor
A new instance of FlashNow.
-
#notice=(message) ⇒ Object
Convenience accessor for
flash.now[:notice]=
.
Constructor Details
#initialize(flash) ⇒ FlashNow
Returns a new instance of FlashNow.
50 51 52 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 50 def initialize(flash) @flash = flash end |
Instance Attribute Details
#flash ⇒ Object
Returns the value of attribute flash
48 49 50 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 48 def flash @flash end |
Instance Method Details
#[](k) ⇒ Object
61 62 63 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 61 def [](k) @flash[k.to_s] end |
#[]=(k, v) ⇒ Object
54 55 56 57 58 59 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 54 def []=(k, v) k = k.to_s @flash[k] = v @flash.discard(k) v end |
#alert=(message) ⇒ Object
Convenience accessor for flash.now[:alert]=
.
66 67 68 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 66 def alert=() self[:alert] = end |
#notice=(message) ⇒ Object
Convenience accessor for flash.now[:notice]=
.
71 72 73 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 71 def notice=() self[:notice] = end |