Skip to content

Instantly share code, notes, and snippets.

@jerryhebert
Created December 9, 2015 19:39
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 jerryhebert/23201a779f52f0a61aee to your computer and use it in GitHub Desktop.
Save jerryhebert/23201a779f52f0a61aee to your computer and use it in GitHub Desktop.
[1] pry(main)>
[2] pry(main)> def foo
[2] pry(main)* def bar
[2] pry(main)* end
[2] pry(main)* bar
[2] pry(main)* end
=> :foo
[3] pry(main)> foo
=> nil
[4] pry(main)> [Object.instance_methods.include?(:foo), Object.private_instance_methods.include?(:foo)]
=> [true, false]
[5] pry(main)> [Object.instance_methods.include?(:bar), Object.private_instance_methods.include?(:bar)]
=> [true, false]
[6] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment