From: wys@... (Clemens Wyss) Date: 2001-03-06T00:10:05+09:00 Subject: [ruby-talk:12025] Re: hooking/wrapping all of a classes methods David Alan Black wrote in : >Hello -- > >What I mean is: > >Let's say I write an IO-layer class with a bunch of methods that do >something with files. I want every method to lock and unlock the file >(or at least check that it is locked, or whatever). I don't feel like >having to remember to write that into every method. > "synchronization"...sound like yet another typical AOP aspect ;-) If we do not have AspectRb (yet), how about writing a special SynchronizingDelgator (could be a subclass of the Delegator) class? I didn't look at the Delegator class so far, but I supsect it is making use of the method_mssing function. Regards Clemens