Skip to content

Instantly share code, notes, and snippets.

@davidbegin
Last active August 29, 2015 14:26
Show Gist options
  • Save davidbegin/1b1a9aeb1537b22798f0 to your computer and use it in GitHub Desktop.
Save davidbegin/1b1a9aeb1537b22798f0 to your computer and use it in GitHub Desktop.
Ruby mind twister
# 6. The superclass of the singleton class of an object is the object's class.
# The superclass of the singleton class of a class is the singleton class
# of the class's superclass.
class Person; end
p = Person.new
puts p.singleton_class.superclass == p.class #=> true
puts Person.singleton_class.superclass == Person.superclass.singleton_class #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment