Skip to content

Instantly share code, notes, and snippets.

@scaint
Created July 26, 2015 21:04
Show Gist options
  • Save scaint/ad45b084e5cef50ae7aa to your computer and use it in GitHub Desktop.
Save scaint/ad45b084e5cef50ae7aa to your computer and use it in GitHub Desktop.
Object.class_eval { def self.private; Object; end }
def MyClass
private
def some_method
end
end
MyClass.private_instance_methods.include? :some_method # => false
MyClass.public_instance_methods.include? :some_method # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment