Module: Swamp::Action::Flash

Defined in:
lib/swamp/rails_actions/action/flash.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/swamp/rails_actions/action/flash.rb', line 6

def self.included(base)
  base.expose :flash
end

Instance Method Details

#flashObject



18
19
20
# File 'lib/swamp/rails_actions/action/flash.rb', line 18

def flash
  @flash ||= Hash[]
end

#flash_alert!(message) ⇒ Object



10
11
12
# File 'lib/swamp/rails_actions/action/flash.rb', line 10

def flash_alert!(message)
  flash[:alert] = message
end

#flash_notice!(message) ⇒ Object



14
15
16
# File 'lib/swamp/rails_actions/action/flash.rb', line 14

def flash_notice!(message)
  flash[:notice] = message
end