I have a mixin for which I would like to get a list of all the classes that have included it. In the mixin module, I did the following:
module MyModule def
module MyMod; end class A; include MyMod; end class B < A; end class C; end ObjectSpace.each_object(Class).select { |c| c.included_modules.include? MyMod } #=> [B, A]