From: David Alan Black Date: 2002-05-14T17:50:35+09:00 Subject: Re: cgi params api Hello -- On Tue, 14 May 2002, Dossy wrote: > On 2002.05.14, Wakou Aoyama wrote: > > Hi, > > > > On Tue, May 14, 2002 at 03:39:26AM +0900, > > Dossy wrote: > > > > > cgi['name'] should return an object of type CGI::Param. > > > CGI::Param#inspect would return the first value it knows > > > of. > > > > I thought so, too. but, is CGI::Param necessary? > > Yes. > > > cgi["key"] return first value as String. > > cgi.params return params as Hash. > > > > foo(cgi["key"]) > > > > cgi.params["key"].each() do |value| > > foo(value) > > end > > The problem is when cgi["key"] wants to return an array. > Then "foo" == cgi["key"] will fail since you're comparing > a String to an Array. But see above... > > cgi["key"] return first value as String. ...so the string comparison would work. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav