Is there anyway to write the following code in Ruby without writing the file to disk?
temp_file = 'path/to/file.csv'
users = [[email protected], [email protected]]
CSV.open(temp_file, "w") do |csv|
csv << data_for_report
end
Reports.sendreport users temp_file
File.delete(temp_file)
The Reports.sendreport attaches a file and sends an email, so it needs to be a file...
Reports
, then you probably are doing it the right way. It's probably more trouble than it's worth to get a section of memory to pretend it's a disk soReports
can read from it. – Catha