From: Holden Glova Date: 2002-08-11T19:27:23+09:00 Subject: Re: To be a Module, or not to be... -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 11 Aug 2002 22:13, ts wrote: > >>>>> "H" == Holden Glova writes: > > H> Ok, with this nice illustration of how it works, I should definately > call H> super from the intialize method i have in the module, no? > > no, with > > module B > def initialize > super > end > end > > class A > include B > end > > A.new > > ruby call B#initialize but the #super in B#initialize will search > #initialize in Object, then Kernel I don't see how that is a bad thing? > > with > > class A > include B > > def initialize > # without super > end > end > > ruby call only A#initialize > > > Guy Decoux Reason why I suggested adding super in the Module was because if the client chooses to do something similar with other modules then by my Module not calling super would mean that the other Module#initialize methods defined in their modules would not be called - is that correct? - -- Signed, Holden Glova -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9Vj0E0X8w8X71zPcRAohXAJ9WMisBAgIBTQ7VAsmNfrCFjLrBSACcDMNY Es5UvvJIUoOGNJunySme1cI= =qbXs -----END PGP SIGNATURE-----