From: Simon Strandgaard Date: 2004-03-04T23:54:43+09:00 Subject: Re: class< neither included nor extended works On Thu, 04 Mar 2004 23:41:28 +0900, Carlos wrote: >> I would like to execute some code at the point >> when the 'class< > def txt.singleton_method_added(mthd) ... end > > is not exactly what you want, but close... Yes its close.. I wonder if there is anything closer? Otherwise I have place a compare inside 'singleton_method_added' which checks if its first time we are being invoked. Thanks for the hint. server> ruby b.rb singleton singleton_method_added singleton aa singleton bb server> cat b.rb txt = "text" class << txt def singleton_method_added(parent) puts "singleton #{parent}" end def aa end def bb end end server> -- Simon Strandgaard