title: Ruby - Creating a file in memory
body: <p>Is there anyway to write the following code in Ruby without writing the file to disk?</p>
  
  <pre><code>temp_file = 'path/to/file.csv'
  users = [a@b.c, c@b.a]
  
  CSV.open(temp_file, "w") do |csv|
    csv &lt;&lt; data_for_report
  end
  
  Reports.sendreport users temp_file
  
  File.delete(temp_file)
  </code></pre>
  
  <p>The Reports.sendreport attaches a file and sends an email, so it needs to be a file... </p>