public
Last active

Viewing the lineage of a Ruby class

  • Download Gist
class_parents.rb
Ruby
1 2 3
def parents(obj)
( (obj.superclass ? parents(obj.superclass) : []) << obj)
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.