Skip to content

Instantly share code, notes, and snippets.

@albertoleal
Created June 7, 2011 11:30
Show Gist options
  • Save albertoleal/1012064 to your computer and use it in GitHub Desktop.
Save albertoleal/1012064 to your computer and use it in GitHub Desktop.
Getting all subclasses
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