title: Delete nested hash according to key => value
body: <p>I have this hash:</p>
  
  <pre><code>response = '{"librairies":[{"id":1,"books":[{"id":1,"qty":1},{"id":2,"qty":3}]},{"id":2,"books":[{"id":1,"qty":0},{"id":2,"qty":3}]}]}'
  </code></pre>
  
  <p>in which I'd like to delete every librairies where, at least, one of the book quantity is null.</p>
  
  <p>For instance, with this given <code>response</code>, I'd expect this return:</p>
  
  <pre><code>'{"librairies":[{"id":1,"books":[{"id":1,"qty":1},{"id":2,"qty":3}]}]}'
  </code></pre>
  
  <p>I've tried this:</p>
  
  <pre><code>parsed = JSON.parse(response)
  
  parsed["librairies"].each do |library|
    library["books"].each do |book|
      parsed.delete(library) if book["qty"] == 0
    end
  end
  </code></pre>
  
  <p>but this returns the exact same <code>response</code> hash, without having deleted the second library (the one with id => 2).</p>