From: Lyndon Samson Date: 2005-09-14T18:58:18+09:00 Subject: Re: ruby and aop ------=_Part_17482_12280818.1126691895148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hows this for a less than sophisticated attempt class Dog def bark puts "WOOF" end end class Proxy def initialize(clazz) @clazz =3D clazz end def method_missing(meth, *parms) @precall.call(meth, *parms) @clazz.send(meth.to_s, *parms) end def precall(&block) @precall =3D block end end d =3D Dog.new d.bark pro=3DProxy.new(d) pro.precall { |meth,parms| puts "Precall method #{meth.to_s}" } pro.bark ------=_Part_17482_12280818.1126691895148--