Created
January 22, 2011 10:23
-
-
Save theleoborges/791025 to your computer and use it in GitHub Desktop.
hacking-rubys-syntax#0
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
# this is the first way to do it | |
class Test | |
def say_hello | |
puts "I'm a private method" | |
end | |
private :say_hello | |
end | |
# and this is the second way | |
class Test | |
#other methods this class might have | |
private | |
def say_hello | |
puts "I'm a private method" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment