# File lib/cookiejar/cookie.rb, line 124 def to_s ver=0, prefix=true case ver when 0 "#{name}=#{value}" when 1 # we do not need to encode path; the only characters required to be # quoted must be escaped in URI str = prefix ? "$Version=#{version};" : "" str << "#{name}=#{value};$Path=\"#{path}\"" if domain.start_with? '.' str << ";$Domain=#{domain}" end if ports str << ";$Port=\"#{ports.join ','}\"" end str end end