class Arun
def arun
afile=File.new("arun1.txt")
if afile
afile.open("arun1.txt","w")
afile.syswrite("hi from arunkumar.............")
afile.close()
afile.open("arun1.txt","r+")
con=afile.sysread(30)
puts con
afile.close()
else
puts "can't open"
end
end
end
a=Arun.new
a.arun
在这里我无法访问它显示调用的arun
私有方法的方法 (NoMethodError)open
#<File:arun1.txt>