Last active
August 29, 2015 14:13
-
-
Save DouglasAllen/b7dea24dc4d1fc0d6e0e to your computer and use it in GitHub Desktop.
Classes are Objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self | |
#=> main | |
self.class | |
#=> Object | |
self.object_id | |
#=> -595331298 | |
o = Object.new | |
#=> #<Object:0xb940af38> | |
# A Ruby object has a class | |
o.class | |
#=> Object | |
# objects are a class in Ruby | |
Object.class | |
#=> Class | |
Class.superclass | |
#=> Module | |
Class.superclass.superclass | |
#=> Object | |
Class.superclass.superclass.superclass | |
#=> BasicObject | |
Class.superclass.superclass.superclass.superclass | |
#=> nil | |
Object.superclass | |
#=> BasicObject | |
Object.superclass.superclass | |
#=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment