From: Ned Konz Date: 2002-07-11T03:03:28+09:00 Subject: Re: Thanks (Re: Accessing caller's binding?) On Wednesday 10 July 2002 10:49 am, Philip Mak wrote: > (I was able to remove the _mycgi stuff because in my application, > there's a global variable called $cgi that is initialized to > CGI.new at the beginning of every new HTTP request.) Well, then, you could do this: class MyClass def method_missing(sym, *args) if $cgi.has_key?(sym) && args.size < 2 return $cgi[sym.to_s][ args[0] || 0 ] end super end end which would look up methods as keys in $cgi, optionally passing indexes: name => $cgi['name'][0] name(1) => $cgi['name'][1] -- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE