Coming back to this thread after a long hiatus, sorry about that ... On Jun 2, 2005, at 8:57 AM, Glenn Parker wrote: > 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. > I can't; DomainObject#text doesn't actually define a new method, it just adds to a class-level array of fields that are accessed in method_missing. I actually solved part of the problem by using undef_method, as Matz suggested. Another part of the problem is still unsolved, so I'll be responding to Matz' email in a few seconds, explaining it in more detail ... Francis Hwang http://fhwang.net/