Created
January 13, 2015 23:11
-
-
Save glennpratt/7f637d272f3faef518a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [1] pry(main)> class Foo | |
| [1] pry(main)* private def bar; end | |
| [1] pry(main)* def baz; end | |
| [1] pry(main)* end | |
| => :baz | |
| [2] pry(main)> Foo.new.baz | |
| => nil | |
| [3] pry(main)> Foo.new.bar | |
| NoMethodError: private method `bar' called for #<Foo:0x007fc34419c6c0> | |
| from (pry):6:in `__pry__' | |
| [4] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment