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.
85 86 87 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 85 def initialize(flash) @flash = flash end |
Instance Attribute Details
#flash ⇒ Object
Returns the value of attribute flash
83 84 85 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 83 def flash @flash end |
Instance Method Details
#[](k) ⇒ Object
96 97 98 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 96 def [](k) @flash[k.to_s] end |
#[]=(k, v) ⇒ Object
89 90 91 92 93 94 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 89 def []=(k, v) k = k.to_s @flash[k] = v @flash.discard(k) v end |
#alert=(message) ⇒ Object
Convenience accessor for flash.now[:alert]=
.
101 102 103 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 101 def alert=() self[:alert] = end |
#notice=(message) ⇒ Object
Convenience accessor for flash.now[:notice]=
.
106 107 108 |
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 106 def notice=() self[:notice] = end |