Created
May 1, 2014 12:33
-
-
Save code-later/6a2ccc9d92690e192f5e to your computer and use it in GitHub Desktop.
private: Keyword or Method #Ruby
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
class Foo | |
send :private | |
def bar | |
puts "I'm private" | |
end | |
end | |
Foo.new.bar | |
# private method `bar' called for #<Foo:0x00000102816480> (NoMethodError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment