Skip to content

Instantly share code, notes, and snippets.

@theleoborges
Created January 22, 2011 10:23
Show Gist options
  • Save theleoborges/791025 to your computer and use it in GitHub Desktop.
Save theleoborges/791025 to your computer and use it in GitHub Desktop.
hacking-rubys-syntax#0
# 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