Class: ActionDispatch::Flash::FlashNow

Inherits:
Object
  • Object
show all
Defined in:
actionpack/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.


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

def initialize(flash)
  @flash = flash
end

Instance Attribute Details

#flashObject

Returns the value of attribute flash.


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

def flash
  @flash
end

Instance Method Details

#[](k) ⇒ Object


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

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

#[]=(k, v) ⇒ Object


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

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

#alert=(message) ⇒ Object

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


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

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

#notice=(message) ⇒ Object

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


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

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