Created
June 25, 2012 08:56
-
-
Save jgaskins/2987477 to your computer and use it in GitHub Desktop.
Private attr_{reader,writer,accessor} methods
This file contains 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
class Foo | |
private | |
attr_reader :bar | |
end | |
p Foo.new.bar # => Chucks an exception for private method 'bar' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment