Created
February 20, 2013 14:48
-
-
Save jarrettmeyer/4996029 to your computer and use it in GitHub Desktop.
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 X | |
def do_something | |
'**PUBLIC**' | |
end | |
private | |
def do_something_privately | |
'--private--' | |
end | |
end | |
> x = X.new | |
> x.do_something # => **PUBLIC** | |
> x.do_something_privately # => NoMethodError: private method do_something_privately | |
> x.instance_eval { do_something_privately } # => --private-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment