title: Why the Ruby File class not contain a size instance method
body: <p>The File class has a class method called size which takes a path and returns the size of the file that the path points to. What would be a reason to not have a instance method called size on a File. </p>
  
  <p>Here is why it matters to me. </p>
  
  <p>I am using the httpclient gem. I use this to upload a file to a server. For example I would use the following statement to upload a file to the server using httpclient</p>
  
  <pre><code>file=File.open("foo.txt")
  HttpClient.new.put("/upload", file)
  </code></pre>
  
  <p>If I do not add the size instance method to the File class it complains so I went ahead and monkey patched it as follows,</p>
  
  <pre><code> class File
     def size
         @file_size ||= File.size(self.path)
     end
   end
  </code></pre>
  
  <p>This works but I wonder if there is a reason why the size method was not added as an instance method and if there is a better way to do what I have done.</p>