From: "David A. Black" Date: 2004-03-04T23:08:31+09:00 Subject: Re: class< neither included nor extended works Hi -- On Thu, 4 Mar 2004, Simon Strandgaard wrote: > I would like to execute some code at the point > when the 'class< > But I cannot figure out how ? > > server> ruby a.rb > server> cat a.rb > txt = "text" > class << txt > def included(parent) > puts "included" > end > def extended(parent) > puts "extended" > end > def self.included(parent) > puts "self.included" > end > def self.extended(parent) > puts "self.extended" > end > end I'm not sure what you mean. Aren't the 'def's being executed? txt = "text" class << txt def x; puts "hi"; end end txt.x # hi David -- David A. Black dblack@wobblini.net