Skip to content

Instantly share code, notes, and snippets.

@edisonywh
Created November 9, 2018 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edisonywh/e4efd99fe43b5523c46d6ad90a5b26e5 to your computer and use it in GitHub Desktop.
Save edisonywh/e4efd99fe43b5523c46d6ad90a5b26e5 to your computer and use it in GitHub Desktop.
2.3.1 :001 > Foo.ancestors
=> [Foo, Object, Kernel, BasicObject]
2.3.1 :002 > Foo.superclass #superclass allow us to see what class the receiver inherited from. AKA, the parent of current class.
=> Object
2.3.1 :003 > Object.superclass
=> BasicObject
(Kernel is a Module, you could quickly verify it by doing Kernel.class)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment