From: Francis Hwang Date: 2005-06-02T12:20:48+09:00 Subject: Re: preventing Object#send from dispatching to a global method? On May 29, 2005, at 8:54 PM, Jim Weirich wrote: > On Saturday 28 May 2005 11:05 pm, Francis Hwang wrote: >> I wanted to trigger some methods to undefine instance methods of >> 'fname' in User, but I can't do that with Class.inherited -- because >> at >> the time that the User class is being defined, I don't know that I'm >> looking for global methods named 'fname' and 'lname'. >> >> It feels like, from perusing the archives, there is currently no way >> to >> be notified when a class definition is finished. Correct? > > I don't know of any ... however, would this help? > > class User < Lafcadio::DomainObject > fields do > text 'fname' > text 'lname' > end > end > > You can have fields perform actions at the end of the block. I don't > know if > this is good enough, or if you really need it at the end of the class > def. Thanks for the suggestion, but that's probably too cumbersome. For the time being I suppose I'll just have to warn users of the lib not to have global methods named the same as the auto-methods. It's probably not a common problem, anyway. Francis Hwang http://fhwang.net/