Module: ActionController::Flash::ClassMethods

Defined in:
lib/action_controller/metal/flash.rb

Instance Method Summary collapse

Instance Method Details

#add_flash_types(*types) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/action_controller/metal/flash.rb', line 14

def add_flash_types(*types)
  types.each do |type|
    next if _flash_types.include?(type)

    define_method(type) do
      request.flash[type]
    end
    helper_method type

    self._flash_types += [type]
  end
end