Class: ActionDispatch::Flash::FlashNow

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/middleware/flash.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flash) ⇒ FlashNow

Returns a new instance of FlashNow.



83
84
85
# File 'lib/action_dispatch/middleware/flash.rb', line 83

def initialize(flash)
  @flash = flash
end

Instance Attribute Details

#flashObject

Returns the value of attribute flash.



81
82
83
# File 'lib/action_dispatch/middleware/flash.rb', line 81

def flash
  @flash
end

Instance Method Details

#[](k) ⇒ Object



94
95
96
# File 'lib/action_dispatch/middleware/flash.rb', line 94

def [](k)
  @flash[k.to_s]
end

#[]=(k, v) ⇒ Object



87
88
89
90
91
92
# File 'lib/action_dispatch/middleware/flash.rb', line 87

def []=(k, v)
  k = k.to_s
  @flash[k] = v
  @flash.discard(k)
  v
end

#alert=(message) ⇒ Object

Convenience accessor for flash.now[:alert]=.



99
100
101
# File 'lib/action_dispatch/middleware/flash.rb', line 99

def alert=(message)
  self[:alert] = message
end

#notice=(message) ⇒ Object

Convenience accessor for flash.now[:notice]=.



104
105
106
# File 'lib/action_dispatch/middleware/flash.rb', line 104

def notice=(message)
  self[:notice] = message
end