From: Joel VanderWerf Date: 2002-12-13T05:12:30+09:00 Subject: Re: How to detect Module Inclusion for Class Instances (like Module#extend_object)? Martin Hart wrote: ... >>>Is there a way to tell that a module is being included by a class? >>>Specifically I want to detect this for instances of the class in question >>>- sort of like using #extend_object. > > >>Take a look at Module#append_features. > > > AFAICT that works for the class - but not for instances of it... 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