diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 18:25:36 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 18:25:36 -0800 |
commit | dea160266fee0576c2059a0699cbf93b465e95a2 (patch) | |
tree | 34042e04c49cbb1c5b7f863a0995d85e5a76f890 /actionpack | |
parent | ffad4927b1803765fca78241d2f368c33888c048 (diff) | |
download | rails-dea160266fee0576c2059a0699cbf93b465e95a2.tar.gz rails-dea160266fee0576c2059a0699cbf93b465e95a2.tar.bz2 rails-dea160266fee0576c2059a0699cbf93b465e95a2.zip |
rename @used to something a bit more meaningful
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 |