From 6b6944b3246a2b691d1fba6d3b8439d5db9e84c4 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Wed, 20 Mar 2013 01:42:16 +0900 Subject: [PATCH] Add inspect. --- lib/http/cookie.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/http/cookie.rb b/lib/http/cookie.rb index b8cf906..806b535 100644 --- a/lib/http/cookie.rb +++ b/lib/http/cookie.rb @@ -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)