diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-01 13:37:14 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-01 13:37:14 -0700 |
commit | fdd619e9a7a5b9457f77e6322c920b99c3c09599 (patch) | |
tree | 4b621fb86407100296a002d7afbec89979ef11a5 /actionpack/lib/action_dispatch/middleware | |
parent | 90248d2953789f8631480c767ebf3accdbda6a7a (diff) | |
download | rails-fdd619e9a7a5b9457f77e6322c920b99c3c09599.tar.gz rails-fdd619e9a7a5b9457f77e6322c920b99c3c09599.tar.bz2 rails-fdd619e9a7a5b9457f77e6322c920b99c3c09599.zip |
CookieJar is enumerable. fixes #2795
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 1c312f2587..8c4615c0c1 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -85,6 +85,7 @@ module ActionDispatch class CookieOverflow < StandardError; end class CookieJar #:nodoc: + include Enumerable # This regular expression is used to split the levels of a domain. # The top level domain can be any string without a period or @@ -124,6 +125,10 @@ module ActionDispatch alias :closed? :closed def close!; @closed = true end + def each(&block) + @cookies.each(&block) + end + # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists. def [](name) @cookies[name.to_s] |