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.