I want to get a list of modules which are included directly in the class
in ruby. Example: Suppose below are two modules and a class defined in
How can I get list of modules which are included directly in the class?
Here in above example, M1 and M2 are only included in class MyClass so I
only want a list which contains modules M1 and M2 for MyClass. If we
call â€œMyClass.ancestorsâ€ which returns all the modules which are include
directly or indirectly in this class and all parent class hierarchy that
exactly I donâ€™t want to get.