From: Markus Date: 2004-09-26T15:01:21+09:00 Subject: Re: local_method_missing possible 1) Wouldn't that cause infinite recursion if you called B.new.a? 2) Is this something like CLOS (common lisp object system) around methods? (See http://www.aiai.ed.ac.uk/~jeff/clos-guide.html). If so, I have an partial implementation that works in 1.8.0 (and I hope will work in 1.8.2 final) -- Markus On Sat, 2004-09-25 at 20:10, trans. (T. Onoma) wrote: > On Saturday 25 September 2004 10:42 pm, Markus wrote: > > I'm not sure I understand what you're getting at. Why would you > > subclass A if you didn't want to inherit any of the methods from A? > > Hi. > > It's related to AOP. The basic idea is to be able to reroute method > invocations. > > class A > def a; puts "here"; end > end > class B < A > def b(meth) > puts "before" > send(meth) > puts "after" > end > def local_method_missing(sym, *args) > if /^a/ =~ meth.to_s > b(meth) > end > end > end > > T.