title: private method `open' called for #<File:arun1.txt> (NoMethodError)
body: <pre><code>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
  </code></pre>
  
  <p>Here I can't access the <code>arun</code> method its shows private method <code>open</code> called for <code>#&lt;File:arun1.txt&gt;</code>  (NoMethodError)</p>