From: Glenn Parker Date: 2005-06-02T21:57:40+09:00 Subject: Re: preventing Object#send from dispatching to a global method? Francis Hwang wrote: > On May 30, 2005, at 9:02 PM, Glenn Parker wrote: >> Francis Hwang wrote: >> >>> It feels like, from perusing the archives, there is currently no way >>> to be notified when a class definition is finished. Correct? >> >> Not that I could find, and I've mentioned this as an annoying >> limitation of Ruby myself. > > Should I submit an RCR? Haven't done one before. Would it be called? > Class#inherited_finished ? I would say it's worth an RCR, but a class definition is never really finished, so a different name is needed. Maybe Module#end_update would make more sense. This would be a callback that is invoked when the interpreter gets to the final "end" of a Module/Class block. Extra points if it passed a list of constants that were added, removed, or redefined. Can you accomplish your original goal with Module#method_added? If Lafcadio::DomainObject#text defines new methods, that seems like a sufficiently solid hook. -- Glenn Parker | glenn.parker-AT-comcast.net |