From f1fe763007a38a813809c906e0c3a357e52eb423 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Fri, 12 Apr 2013 01:40:17 +0900 Subject: [PATCH] CookieJar#cookie(): Allow call without an argument. --- lib/http/cookie_jar.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/http/cookie_jar.rb b/lib/http/cookie_jar.rb index 22d9259..4b37928 100644 --- a/lib/http/cookie_jar.rb +++ b/lib/http/cookie_jar.rb @@ -85,9 +85,10 @@ class HTTP::CookieJar self end - # Gets an array of cookies that should be sent for the URL/URI, - # updating the access time of each cookie. - def cookies(url) + # Gets an array of cookies sorted by the path and creation time. If + # `url` is given, only ones that should be sent to the URL/URI are + # selected, with the access time of each of them updated. + def cookies(url = nil) each(url).sort end