Skip to content

Instantly share code, notes, and snippets.

@jayrobin
Created October 11, 2016 18:40
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 jayrobin/7e89a81aeac3b2d3cc0ba9bb23c0f46f to your computer and use it in GitHub Desktop.
Save jayrobin/7e89a81aeac3b2d3cc0ba9bb23c0f46f to your computer and use it in GitHub Desktop.
def some_method
# this method is in the global scope and therefore is added to ‘Object’
end
class MyClass
end
puts MyClass.private_methods.include?(:some_method) # true
my_class = MyClass.new
puts my_class.private_methods.include?(:some_method) # true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment