On Mon, May 13, 2002 at 02:59:59AM +0900,
 Wakou Aoyama wrote:

> if 2 <= cgi["name"].size   # or, if 1 <= cgi["name"].size
>   cgi["name"].each() do |value|
>     foo(value)
>   end
> else
>   foo(cgi["name"])
> end

???  size is unnecessary.

cgi.rb now:

  cgi["name"].each() do |value|
    foo(value)
  end

this code work, even if cgi["name"] has only one value.



if you know cgi["name"] has only one value,

  foo(cgi["name"].to_s)

a problem is this. you wish

  foo(cgi["name"])



cgi["name"].each  --> keep
cgi["name"]       --> cgi["name"].to_s


-- 
Wakou Aoyama  <wakou / fsinet.or.jp>