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.



53
54
55
# File 'lib/action_dispatch/middleware/flash.rb', line 53

def initialize(flash)
  @flash = flash
end

Instance Attribute Details

#flashObject

Returns the value of attribute flash.



51
52
53
# File 'lib/action_dispatch/middleware/flash.rb', line 51

def flash
  @flash
end

Instance Method Details

#[](k) ⇒ Object



64
65
66
# File 'lib/action_dispatch/middleware/flash.rb', line 64

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

#[]=(k, v) ⇒ Object



57
58
59
60
61
62
# File 'lib/action_dispatch/middleware/flash.rb', line 57

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

#alert=(message) ⇒ Object

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



69
70
71
# File 'lib/action_dispatch/middleware/flash.rb', line 69

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

#notice=(message) ⇒ Object

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



74
75
76
# File 'lib/action_dispatch/middleware/flash.rb', line 74

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