From: ptkwt@... (Phil Tomson) Date: 2005-11-24T04:03:11+09:00 Subject: Re: pattern: auto-running module init code In article <43846a75$0$1813$edfadb0f@dread11.news.tele.dk>, Daniel Schierbeck wrote: >Ideally, there would be a method hook that was called when a class >including the module was instantiated. > > module Fooable > def self.initialized(obj, *args, &block) > puts "A class including Fooable has been instantiated!" > obj.do_something(*args) # whatever > end > end But as Sean pointed out we essentially get the same behavior by calling 'super' somewhere in the including class's constructor. Phil