From: Wakou Aoyama Date: 2003-02-08T05:59:29+09:00 Subject: Re: easy access for CGI query Hello, again. require "cgi" ENV['REQUEST_METHOD'] = 'GET' ENV['QUERY_STRING'] = 'key=value1&key%20with%20spaces=value2&key%2fwith%2fslashes=value3' class CGI class Query def initialize(params, substitute) @params = params @substitute = substitute end def method_missing(key) @params[@substitute[key] || key.to_s].first end end def query(substitute = {}) CGI::Query.new(@params, substitute) end end q = CGI.new.query p q.key # ==> "value1" p q.key_with_spaces # ==> nil p q.key_with_slashes # ==> nil q = CGI.new.query( :ruby_name => "cgi name", :key_with_spaces => "key with spaces", :key_with_slashes => "key/with/slashes" ) p q.key # ==> "value1" p q.key_with_spaces # ==> "value2" p q.key_with_slashes # ==> "value3" -- Wakou Aoyama