From: Dossy Date: 2002-07-14T04:07:02+09:00 Subject: Re: Dynamic Methods On 2002.07.14, John wrote: > > In any case, what did you need this for? > > I assume you mean having the class respond to methods that match a regexp? > > So you can have a user input commands without having to type the whole > command. Also for having aliases for commands without having to write each > method to call the main method. > > class foo > def /[ls|dir|directory]/ > end > def /desc.*/ > end > end > > foo.ls > foo.dir > foo.directory > > foo.desc > foo.describe > > Personally I think its kinda neat. I love the power of regular expressions. So, implement #method_missing that delegates to the actual method name using regex as the mapper? -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)