Created
June 7, 2011 11:30
-
-
Save albertoleal/1012064 to your computer and use it in GitHub Desktop.
Getting all subclasses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SimpleBaseClass | |
def self.inherited(new_subclass) | |
puts "Hey #{new_subclass} is now a sublcass of #{self}!" | |
end | |
end | |
class SubClass < SimpleBaseClass | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment