Last active
January 4, 2016 14:59
-
-
Save floehopper/8637991 to your computer and use it in GitHub Desktop.
Differences between ancestors of singleton class between Ruby v2.0 and v2.1
This file contains hidden or 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
# ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0] | |
class X; end | |
X.ancestors # => [X, Object, Kernel, BasicObject] | |
X.singleton_class # => #<Class:X> | |
X.singleton_class.ancestors # => [Class, Module, Object, Kernel, BasicObject] | |
# ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0] | |
class X; end | |
X.ancestors # => [X, Object, Kernel, BasicObject] | |
X.singleton_class # => #<Class:X> | |
X.singleton_class.ancestors # => [#<Class:X>, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject] | |
# The following are extra ancestors in Ruby v2.1 | |
# [#<Class:X>, #<Class:Object>, #<Class:BasicObject>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment