Skip to content

Instantly share code, notes, and snippets.

@tlehman
Forked from sferik/classes.rb
Last active December 20, 2015 22:48
Show Gist options
  • Save tlehman/6207474 to your computer and use it in GitHub Desktop.
Save tlehman/6207474 to your computer and use it in GitHub Desktop.
graph = {}
ObjectSpace.each_object(Class) do |klass|
sup = klass.superclass and graph[klass] = sup
end
puts "digraph{overlap=false;"
graph.map do |key, value|
puts %("#{key}"\n"#{key}"->"#{value}")
end
puts"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment