From: Gavin Sinclair Date: 2002-12-13T11:03:47+09:00 Subject: Re: How to detect Module Inclusion for Class Instances (like Module#extend_object)? From: "Joel VanderWerf" > > > >>Take a look at Module#append_features. > > > > OK, I see now. Why can't you just use initialize? > > module P > def initialize(*args) > super > puts "Initializing P" > end > end > > class B > include P > end > > a = B.new You can, but why on earth do you think it will do what you want? irb(main):001:0> module X irb(main):002:1> def initialize(y) irb(main):003:2> @y = y irb(main):004:2> end irb(main):005:1> end nil irb(main):006:0> class Y irb(main):007:1> include X irb(main):008:1> end Y irb(main):009:0> Y.new(6) # I'm not sending this to the list, because I may have misunderstood what you want to do, and don't have time to fully investigate right now :) Cheers, Gavin