From: Holden Glova Date: 2002-08-11T18:32:22+09:00 Subject: Re: To be a Module, or not to be... -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 11 Aug 2002 21:25, ts wrote: > >>>>> "H" == Holden Glova writes: > > H> module ROS > H> module Persistable > > It really depend on what you want to do > > > pigeon% cat b.rb > #!/usr/bin/ruby > module ROS > module Persistable > > def initialize > # I want these variables to be instance vars. > @is_persistent = false > @timestamp = nil > end > end > end > > class A > include ROS::Persistable > > def initialize > @a = 12 > super > end > end > > p A.new > pigeon% > > pigeon% b.rb > # > pigeon% > > > > Guy Decoux Thank you for the quick response Guy! Although I'm not sure how the initialize method in the Module is called. I see you make a call to super there, but I was not aware that a super call would call methods in a Module! The behavior is exactly what was desired though. Must I call super from the class to get the Modules initialize method called? - -- Signed, Holden Glova -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9VjAe0X8w8X71zPcRAof4AJ9Gut4Na/K9Z5Fn30KcN1QmuraYLQCdHVoh zrwBjyo7Jx8/O00JyVyWuY0= =c2r9 -----END PGP SIGNATURE-----