Add inspect.

This commit is contained in:
Akinori MUSHA 2013-03-20 01:42:16 +09:00
parent 66f37b20dd
commit 6b6944b324

View file

@ -594,6 +594,13 @@ class HTTP::Cookie
string
end
def inspect
'#<%s:' % self.class << PERSISTENT_PROPERTIES.map { |key|
'%s=%s' % [key, instance_variable_get(:"@#{key}").inspect]
}.join(', ') << ' origin=%s>' % [@origin ? @origin.to_s : 'nil']
end
# Compares the cookie with another. When there are many cookies with
# the same name for a URL, the value of the smallest must be used.
def <=>(other)