title: Accessing values in nested hash
body: <p>I'm trying to filter nested hashes and pull various keys and values.  Here is the hash I'm looking at:</p>
  
  <pre><code>exp = {
    fam: {cty: "bk", ins: 3},
    spec: {cty: "man", ins: 2},
    br: {cty: "qns", ins: 1},
    aha: {cty: "man", ins: 0}
  }
  </code></pre>
  
  <p>I'm trying to find all the hash keys where <code>cty</code> is <code>"man"</code>.  I'd like to run something where the result is the following hash:  </p>
  
  <pre><code>e = {
  spec: {cty: "man", ins: 2}, 
  aha: {cty: "man", ins: 0}
  }
  </code></pre>
  
  <p>I tried this and it seems like it almost works:     </p>
  
  <pre><code>exp.each do |e, c, value|
    c = :cty.to_s
    value = "man"
    if e[c] == value
      puts e
    end
  end
  </code></pre>
  
  <p>But the result I get is:</p>
  
  <pre><code>=&gt; true 
  </code></pre>
  
  <p>Instead of what I'm looking for:</p>
  
  <pre><code>e = {
  spec: {cty: "man", ins: 2}, 
  aha: {cty: "man", ins: 0} 
  }
  </code></pre>