From: Robert Klemme Date: 2005-08-31T21:51:24+09:00 Subject: Re: Intercepting, Resuming Overridden Methods Gavin Kistner wrote: > Is there a clean, good, easy way to do the following: > > class Human; end > class Male < Human > def laugh > puts "Yo ho ho" > end > end > class Female < Human > def laugh > puts "Tee hee" > end > end > > module Yokel > #...special code here... > end > > class Human > include Yokel > end > > m = Male.new > m.laugh > #=> "Slapping my knee" > #=> "Yo ho ho" > #=> "Snorting" > > > f = Female.new > f.laugh > #=> "Slapping my knee" > #=> "Tee hee" > #=> "Snorting" I once hacked something together which might help you. It's here http://www.rubygarden.org/ruby?MethodHooks And there have been lengthy discussions about the issue quite some time ago. Guess you'll find them if you search for "method hooks". Kind regards robert