summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 07:16:41 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 07:16:41 +0000
commiteaa8ca6b78be62f74ccb79f91631c07e82e5bb2a (patch)
treefa9b82594b6096ad5c169ee26c8b673d585d1659 /lib
parent29929d799d4da41a177feba7e0735b6b571dfa45 (diff)
merge revision(s) 24913:
* lib/cgi/cookie.rb (value): Keep CGI::Cookie#value in sync with the cookie itself. A patch by Arthur Schreiber [ruby-core:17634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 5d74aa08ff..c999503a59 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -822,8 +822,8 @@ class CGI
super(@value)
end
- attr_accessor("name", "value", "path", "domain", "expires")
- attr_reader("secure")
+ attr_accessor("name", "path", "domain", "expires")
+ attr_reader("secure", "value")
# Set whether the Cookie is a secure cookie or not.
#
@@ -833,16 +833,16 @@ class CGI
@secure
end
+ def value=(val)
+ @value.replace(Array(val))
+ end
+
# Convert the Cookie to its string representation.
def to_s
buf = ""
buf += @name + '='
- if @value.kind_of?(String)
- buf += CGI::escape(@value)
- else
- buf += @value.collect{|v| CGI::escape(v) }.join("&")
- end
+ buf += @value.map { |v| CGI::escape(v) }.join("&")
if @domain
buf += '; domain=' + @domain