title: Ruby: remove empty braces in array of hashes
body: <p>The content I'm scraping includes some blank elements. I either need to stop variables being set if there is no data (preferable) or just do some surgery afterwards and completely delete hashes containing blanks. </p>
  
  <p>Here's my scrape code:</p>
  
  <pre><code>eqs = []
  
  nokogiri_page.xpath('//table/tr').each do |row|
    date = row.xpath('td[1]/a/text()').text.strip
    location = row.xpath('td[5]/text()').text.strip
  
    eqs.push(
      date: date,
      location: location
    )
  end
  </code></pre>
  
  <p>Some of these are blank, and I can't know which beforehand. So I tried iterating over the array and deleting blank values with:</p>
  
  <pre><code>eqs.each do |event|
    event.reject! {|k, v| v.empty? || v=="  " || v=="" }
  end
  </code></pre>
  
  <p>This successfully removes blank keys and values, but I am still left with the empty curly braces... </p>
  
  <p>Output:</p>
  
  <pre><code>[
   {},
   {},
   {},
   {
      :date=&gt;"2016-12-14 13:19:55",
      :location=&gt;"Myanmar"
   },
   {
      :date=&gt;"2016-12-13 17:57:04",
      :location=&gt;"Northern Sumatra, Indonesia"
   }
  ]
  </code></pre>
  
  <p>I want to get rid of the empty hashes completely! Anyone know what I'm getting wrong here?</p>