-1
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
方法的節目呼籲#<File:arun1.txt>
(NoMethodError)私有方法open
私有方法'打開」呼籲#<文件:arun1.txt>(NoMethodError)