title: recursively search hash in ruby and return an array of items
body: <p>I have a hash that I'm getting from using JSON.parse. I am inserting into db at that point. The data structure uses acts as tree so I can have a hash like this:  </p>
  
  <pre><code>category_attributes
    name: "Gardening"
    items_attributes:
      item 1: "backhoe"
      item 2: "whellbarrel"
    children_attributes
      name: "seeds"
      items_attributes
        item 3: "various flower seeds"
        item 4: "various tree seeds"
      children_attributes
        name: "agricultural seeds"
        items_attributes
          item 5: "corn"
          item 6: "wheat"
  </code></pre>
  
  <p>For this hash, I'd like to return an array of all the items_attributes. I have seen this question <a href="https://stackoverflow.com/questions/3748744/traversing-a-hash-recursively-in-ruby">Traversing a Hash Recursively in Ruby</a> but it seems different.  Is there a way to recursively search a hash and return all those elements? Ideally, empty items_attributes should come back with nothing rather than nil.</p>
  
  <p>thx</p>