Permalink
Browse files

Add rdoc for Cookie.parse.

  • Loading branch information...
1 parent b1d58e1 commit 3c7a389808d38912e344159d1d2f33db3eee3da1 @knu knu committed Nov 11, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/mechanize/cookie.rb
View
3 lib/mechanize/cookie.rb
@@ -74,6 +74,9 @@ def initialize(*args)
alias for_domain? for_domain
class << self
+ # Parses a Set-Cookie header line +str+ sent from +uri+ into an
+ # array of Cookie objects. Note that this array may contain
+ # nil's when some of the cookie-pairs are malformed.
def parse(uri, str, log = Mechanize.log)
return str.split(/,(?=[^;,]*=)|,$/).map { |c|
cookie_elem = c.split(/;+/)

0 comments on commit 3c7a389

Please sign in to comment.