How do I tell which modules have been mixed into a class?

Viewed 15356

I have a class that has a number of modules that are mixed in with it based on some runtime criteria.

I want to be able to get a list of which modules have been mixed into this class. How can you do that?

UPDATE

So when I said class I meant object as it is the object that is being extended at runtime using:

obj.extend(MyModule)

obj.included_modules and obj.ancestors don't exist so you can't get the modules that have been mixed in from there.

7 Answers
Related