title: How to add extension to ruby Tempfile object?
body: <p>How to add extension for <code>Tempfile</code> object?</p>
  
  <pre><code>image_path = "https://api.tinify.com/output/g85retpckb5fz2x8zpjrvtj0jcv1txm0"
  image = open(image_path)
  image.path # "/tmp/open-uri20191225-21585-oo95rb"
  </code></pre>
  
  <p>Now I want to make this file has <em>jpg</em> extension how can I do that?</p>
  
  <p>I have also tried to convert it to <code>File</code> class but couldn't change extension too.</p>
  
  <pre><code>new_image = File.new(image)
  new_image.path # "/tmp/open-uri20191225-21585-oo95rb"
  </code></pre>