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.



86
87
88
# File 'lib/action_dispatch/middleware/flash.rb', line 86

def initialize(flash)
  @flash = flash
end

Instance Attribute Details

#flashObject

Returns the value of attribute flash.



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

def flash
  @flash
end

Instance Method Details

#[](k) ⇒ Object



97
98
99
# File 'lib/action_dispatch/middleware/flash.rb', line 97

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

#[]=(k, v) ⇒ Object



90
91
92
93
94
95
# File 'lib/action_dispatch/middleware/flash.rb', line 90

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

#alert=(message) ⇒ Object

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



102
103
104
# File 'lib/action_dispatch/middleware/flash.rb', line 102

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

#notice=(message) ⇒ Object

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



107
108
109
# File 'lib/action_dispatch/middleware/flash.rb', line 107

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