mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
Rename expire to expire!, to reduce the risk of making a typo.
This commit is contained in:
parent
f04714741f
commit
66f37b20dd
3 changed files with 4 additions and 4 deletions
|
|
@ -503,7 +503,7 @@ class HTTP::Cookie
|
|||
|
||||
# Expires this cookie by setting the expires attribute value to a
|
||||
# past date.
|
||||
def expire
|
||||
def expire!
|
||||
self.expires = UNIX_EPOCH
|
||||
self
|
||||
end
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class HTTP::CookieJar
|
|||
if (debt = domain_cookies.size - HTTP::Cookie::MAX_COOKIES_PER_DOMAIN) > 0
|
||||
domain_cookies.sort_by!(&:created_at)
|
||||
domain_cookies.slice!(0, debt).each { |cookie|
|
||||
add(cookie.expire)
|
||||
add(cookie.expire!)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ class HTTP::CookieJar
|
|||
if (debt = all_cookies.size - HTTP::Cookie::MAX_COOKIES_TOTAL) > 0
|
||||
all_cookies.sort_by!(&:created_at)
|
||||
all_cookies.slice!(0, debt).each { |cookie|
|
||||
add(cookie.expire)
|
||||
add(cookie.expire!)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ class TestHTTPCookie < Test::Unit::TestCase
|
|||
assert_equal false, cookie.expired?
|
||||
assert_equal true, cookie.expired?(cookie.expires + 1)
|
||||
assert_equal false, cookie.expired?(cookie.expires - 1)
|
||||
cookie.expire
|
||||
cookie.expire!
|
||||
assert_equal true, cookie.expired?
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue