Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Delegate to @flashes with 'delegate' instead of manually."

This reverts commit 701e855.
  • Loading branch information...
commit 1d43409d32a7c2c05513887d1c10243a4e620a93 1 parent 3dedf5f
@tenderlove tenderlove authored
Showing with 24 additions and 2 deletions.
  1. +24 −2 actionpack/lib/action_dispatch/middleware/flash.rb
View
26 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -73,8 +73,6 @@ def notice=(message)
class FlashHash
include Enumerable
- delegate :[], :keys, :key?, :empty?, :clear, :each, :to => :@flashes
-
def initialize #:nodoc:
@used = Set.new
@closed = false
@@ -96,12 +94,24 @@ def []=(k, v) #:nodoc:
@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 @@ def to_hash
@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:
Please sign in to comment.
Something went wrong with that request. Please try again.