Skip to content

Instantly share code, notes, and snippets.

@smsohan
Created August 12, 2011 15:02
Show Gist options
  • Save smsohan/1142228 to your computer and use it in GitHub Desktop.
Save smsohan/1142228 to your computer and use it in GitHub Desktop.
Listing all mixed in classes of a module
module MyModule
def self.included base
included_classes << base unless included_classes.include?(base)
end
def self.included_classes
@@included ||= []
end
end
class ClassA
include MyModule
end
class ClassB
include MyModule
end
puts MyModule.included_classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment