Skip to content

Instantly share code, notes, and snippets.

@joshnesbitt
Last active August 29, 2015 14:26
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 joshnesbitt/5c489b9e5a286a10a28e to your computer and use it in GitHub Desktop.
Save joshnesbitt/5c489b9e5a286a10a28e to your computer and use it in GitHub Desktop.
How well do you know Ruby? Can you explain what's going on here? What is MyClass.metaclass returning?
class MyClass
def self.metaclass
class << self; self; end
end
end
puts MyClass.metaclass.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment