From: "F. Senault" Date: 2007-07-24T19:50:00+09:00 Subject: Re: Inherited & load Le 24 juillet 2007 � 12:20, Robert Dober a �crit : > On 7/24/07, F. Senault wrote: >> Then, when I use Tester.load!, all the files in the specified path are >> load'ed, and all the classes inheriting from Tester are registered as >> plugins of that class, validated against the obligatory methods, and, >> unless told otherwise, an instance of each is created and made available >> and enumerable through an array. > I do not see any particular reason why not to use Module inclusion; > Instead of > class Tester < Plugin > class Tester > include Plugin ## or maybe extend, I have not looked into the details > end > Now you can be sure that > Plugin#included / Plugin#extended > is executed evry time you load a file. > Did I miss something? > Oh yes of course might be a pain to redesign :(. Yup, basically, I didn't know I'd hit that problem with included, and it *will* be a pain to redesign. OTOH, I can't manage to use included neither : #! /usr/local/bin/ruby module Plugin def self.included(m) puts "#{m} includes me." end end class TestA include Plugin end class TestA1 < TestA ; end Just gives "TestA includes me"... :| Fred -- I feel it move across my skin. I'm reaching up and reaching out, I'm reaching for the random or what ever will bewilder me. And following our will and wind we may just go where no one's been. We'll ride the spiral to the end and may just go where no one's been. (Tool, Lateralus)