From 3d699ae9ffc32665e8f9117c4149e2ae03123bdf Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 20 Mar 1998 09:20:30 +0000 Subject: -a -> -a- ^^;; git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/cgi-lib.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/cgi-lib.rb') diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb index 02720b2835..00be8992f4 100644 --- a/lib/cgi-lib.rb +++ b/lib/cgi-lib.rb @@ -7,14 +7,16 @@ # foo = CGI.new # foo['field'] <== value of 'field' # foo.keys <== array of fields -# foo.inputs <== hash of { => } +# and foo has Hash class methods # if running on Windows(IIS or PWS) then change cwd. if ENV['SERVER_SOFTWARE'] =~ /^Microsoft-/ then Dir.chdir ENV['PATH_TRANSLATED'].sub(/[^\\]+$/, '') end -class CGI +require "delegate" + +class CGI < SimpleDelegator attr("inputs") @@ -61,16 +63,10 @@ class CGI key, val = x.split(/=/,2).collect{|x|unescape(x)} @inputs[key] += ("\0" if @inputs[key]) + (val or "") end - end - def keys - @inputs.keys + super(@inputs) end - def [](key) - @inputs[key] - end - def CGI.message(msg, title = "") print "Content-type: text/html\n\n" print "" -- cgit v1.2.3