Skip to content

Instantly share code, notes, and snippets.

@guivinicius
Created September 15, 2011 20:48
Show Gist options
  • Save guivinicius/1220442 to your computer and use it in GitHub Desktop.
Save guivinicius/1220442 to your computer and use it in GitHub Desktop.
Blockshopper
class Parent
def self.descendants
ObjectSpace.each_object(Class).find_all { |klass| klass if klass < Parent }
end
end
class OlderChild < Parent
end
class YoungerChild < Parent
end
puts Parent.descendants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment