title: How to save a hash into a CSV
body: <p>I am new in ruby so please forgive the noobishness.</p>
  
  <p>I have a CSV with two columns. One for animal name and one for animal type.
  I have a hash with all the keys being animal names and the values being animal type. I would like to write the hash to the CSV without using fasterCSV. I have thought of several ideas what would be easiest.. here is the basic layout.</p>
  
  <pre><code>require "csv"
  
  def write_file
    h = { 'dog' =&gt; 'canine', 'cat' =&gt; 'feline', 'donkey' =&gt; 'asinine' }
  
    CSV.open("data.csv", "wb") do |csv|
      csv &lt;&lt; [???????????]
    end
  end
  </code></pre>
  
  <p>When I opened the file to read from it I opened it <code>File.open("blabla.csv", headers: true)</code>
  Would it be possible to write back to the file the same way? </p>