From: Ruby Admirer Date: 2007-03-01T02:32:22+09:00 Subject: How to get modules included by a class/module (not those from the superclasses) --0-1715608693-1172683540=:80540 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Is there a way to get only the modules included by a given class. Using included_modules returns also the modules that are included by the superclass(es). Example : class MyClass end MyClass.included_modules # will return Kernel As a given module may be included several times in the class hierarchy (e.g. by the class and by one of its superclass), just getting all included modules and removing the included modules from the superclasses may not be a solution. The given module may have been removed erroneously. It would have been great if included_modules takes a boolean parameter in order to disable the recursion like instance_methods for example. Thanks for any help. --------------------------------- Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. --0-1715608693-1172683540=:80540--