diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-29 13:52:44 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-29 13:52:44 -0700 |
commit | 1d43409d32a7c2c05513887d1c10243a4e620a93 (patch) | |
tree | 20209681881dc23718da675f3ead74372ae41747 | |
parent | 3dedf5f0e2924424cfdab73ace019fb5d3d054a1 (diff) | |
download | rails-1d43409d32a7c2c05513887d1c10243a4e620a93.tar.gz rails-1d43409d32a7c2c05513887d1c10243a4e620a93.tar.bz2 rails-1d43409d32a7c2c05513887d1c10243a4e620a93.zip |
Revert "Delegate to @flashes with 'delegate' instead of manually."
This reverts commit 701e8554a8f69b0c81fe794cba985bfda804161b.
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 0b501e9643..2adbce031b 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -73,8 +73,6 @@ module ActionDispatch class FlashHash include Enumerable - delegate :[], :keys, :key?, :empty?, :clear, :each, :to => :@flashes - def initialize #:nodoc: @used = Set.new @closed = false @@ -96,12 +94,24 @@ module ActionDispatch @flashes[k] = v end + def [](k) + @flashes[k] + end + def update(h) #:nodoc: h.keys.each { |k| keep(k) } @flashes.update h self end + def keys + @flashes.keys + end + + def key?(name) + @flashes.key? name + end + def delete(key) @flashes.delete key self @@ -111,6 +121,18 @@ module ActionDispatch @flashes.dup end + def empty? + @flashes.empty? + end + + def clear + @flashes.clear + end + + def each(&block) + @flashes.each(&block) + end + alias :merge! :update def replace(h) #:nodoc: |