title: Ruby Convert String to File
body: <p>Is it possible to convert a string to a file without writing it to disk?</p>
  
  <p>I would like to work ubiquitously with either a string of a file:</p>
  
  <pre><code>input = "123"
  if (ARGV.length == 1)
     input = File.open(ARGV[0])
  
     #do stuff with input
  end
  </code></pre>
  
  <p>Can I create a file from a string (without writing to disk)? Otherwise, I would not be able to do <code>input.readline()</code> when it's a string.</p>