Skip to content

Instantly share code, notes, and snippets.

@jjb
Created April 15, 2011 18:54
Show Gist options
  • Save jjb/922246 to your computer and use it in GitHub Desktop.
Save jjb/922246 to your computer and use it in GitHub Desktop.
Viewing the lineage of a Ruby class
def parents(obj)
( (obj.superclass ? parents(obj.superclass) : []) << obj)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment