title: Name of file-object
body: <p>Is it possible to get name of file, from object of <code>File</code> class?</p>
  
  <p>For example, this method works good:</p>
  
  <pre><code>file = File::basename('/home/user/file.rb') 
  p file # =&gt; file.rb
  </code></pre>
  
  <p>,but for object it doesn't work</p>
  
  <pre><code>file = File.new('/home/user/file.rb')
  p file.basename
  # =&gt; undefined method `basename' for #&lt;File:/home/user/file.rb&gt; (NoMethodError)
  </code></pre>