From dea160266fee0576c2059a0699cbf93b465e95a2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 Dec 2011 18:25:36 -0800 Subject: rename @used to something a bit more meaningful --- actionpack/lib/action_dispatch/middleware/flash.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 1b82b15511..bf381af9e7 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -78,7 +78,7 @@ module ActionDispatch include Enumerable def initialize #:nodoc: - @used = Set.new + @discard = Set.new @closed = false @flashes = {} @now = nil @@ -139,7 +139,7 @@ module ActionDispatch alias :merge! :update def replace(h) #:nodoc: - @used = Set.new + @discard = Set.new @flashes.replace h self end @@ -163,7 +163,7 @@ module ActionDispatch # flash.keep # keeps the entire flash # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded def keep(k = nil) - @used.subtract Array(k || keys) + @discard.subtract Array(k || keys) k ? self[k] : self end @@ -172,7 +172,7 @@ module ActionDispatch # flash.discard # discard the entire flash at the end of the current action # flash.discard(:warning) # discard only the "warning" entry at the end of the current action def discard(k = nil) - @used.merge Array(k || keys) + @discard.merge Array(k || keys) k ? self[k] : self end @@ -181,11 +181,11 @@ module ActionDispatch # This method is called automatically by filters, so you generally don't need to care about it. def sweep #:nodoc: keys.each do |k| - unless @used.include?(k) - @used << k + unless @discard.include?(k) + @discard << k else delete(k) - @used.delete(k) + @discard.delete(k) end end end -- cgit v1.2.3