title: Extracting date values from hashes within Ruby array
body: <p>I have an array that contains a series of hashes as listed below.</p>
  
  <pre><code>[{:pgs=&gt;6, :oo=&gt;"No", :ms_no=&gt;"D3273", :auth=&gt;"Johnson", :ms_recd=&gt;"Mar 14", :ready_for_ce=&gt;"Mar 15", :proj_back_from_ce=&gt;"Apr 1", :final_ok=&gt;"Jul 25", :pub_date=&gt;"Aug 5", :notes=&gt;" "}, 
  {:pgs=&gt;17, :oo=&gt;"No", :ms_no=&gt;"R4382", :auth=&gt;"Jacobs", :ms_recd=&gt;"Apr 12", :ready_for_ce=&gt;"Apr 16", :proj_back_from_ce=&gt;"May 17", :final_ok=&gt;"Jul 10", :pub_date=&gt;"June 10 ", :notes=&gt;" "},
  {:pgs=&gt;15, :oo=&gt;"No",  :ms_no=&gt;"L3291", :auth=&gt;"Smith", :ms_recd=&gt;"Mar 25", :ready_for_ce=&gt;"Mar 26", :proj_back_from_ce=&gt;"Apr 22", :final_ok=&gt;"Jun 21", :pub_date=&gt;"Aug 10 ", :notes=&gt;"Au prompted for cx 4/30", nil=&gt;" 5/15."}]
  </code></pre>
  
  <p>I need to take two take two date values within each hash: the one with the key <code>:ms_recd</code> and the one with the key <code>:pub_date</code>. I then will determine how many days spanned between the two date ranges (for example, 18 days). </p>
  
  <p>Fortunately, I have the last part pretty much figured out. I just need to do </p>
  
  <pre><code>ms_recd1 = DateTime.parse('Apr 24')
  pub_date1 = DateTime.parse('Aug 15')
  (pub_date1 - ms_recd1).to_i 
  </code></pre>
  
  <p>Which returns <code>115</code> (meaning 115 days). So let's say for three hashes, I'll pull out date ranges of 115, 162, and 94 days, and then I'd average it to 123.6 days.</p>
  
  <p>My question is, how do I pull these date values out of this array to do this? I feel like this should be simple, but I can't figure out how it should work.</p>