From: Robert Klemme Date: 2005-02-17T17:19:54+09:00 Subject: Re: adding a dynamic method handler? (long post) "Mark Hubbart" schrieb im Newsbeitrag news:de63abca050216125273686a45@mail.gmail.com... > On Wed, 16 Feb 2005 18:19:50 +0900, Robert Klemme wrote: > > > > "Mark Hubbart" schrieb im Newsbeitrag > > news:de63abca0502152303763354f7@mail.gmail.com... > > > Hi, > > > > > > I've been using method_missing overly much in my code lately, and it's > > > prompted me to think a lot about it's limitations. > > > > > > > > > So, any thoughts? > > > > I'm wondering in which situation you need this. Although I understand the > > benefits of your approach I don't see the use case for this. > > Basically this is for any time that you want the code re-use and ease > of implementation afforded by method_missing, but the benefits of > still having the methods behave mostly as if they were actually > defined, rather than handled dynamically. This is useful for quickly > defining wrapper objects, or objects that delegate to multiple other > objects. > > The idea is that this would be a way of dynamically creating methods > for an object, without resorting to relatively permanent methods like > "class << self; define_method(:foo){...}; end". I'm sorry if I am being stubborn (or dump), but this is still pretty much abstract. I'd like to know which concrete use case made this behavior necessary. Kind regards robert