Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (19 sloc) 0.55 kb
################################################################################
# 8.05_acc_test.rb
#
# * public method
# * private method
################################################################################
class AccTest
def pub
puts "pub is a public method."
end
public :pub # pubメソッドをpublicに指定(指定しなくてもよい)
def priv
puts "priv is a private method"
end
private :priv # privメソッドをprivateに指定
end
acc = AccTest.new
acc.pub #=> pub is a public method
#acc.priv #=> error
Jump to Line
Something went wrong with that request. Please try again.