title: How do I access the data in JSON converted to hash by crack in ruby?
body: <p>Here is the example from the crack documentation:</p>
  
  <pre><code>json = '{"posts":[{"title":"Foobar"}, {"title":"Another"}]}'
  Crack::JSON.parse(json)
  =&gt; {"posts"=&gt;[{"title"=&gt;"Foobar"}, {"title"=&gt;"Another"}]}
  </code></pre>
  
  <p>But how do I actually access the data in the hash?</p>
  
  <p>I've tried the following:</p>
  
  <pre><code>array = Crack::JSON.parse(json)
  array["posts"]
  </code></pre>
  
  <p>array["posts"] shows all the values, but I tried array["posts"]["title"] and it didn't work.</p>
  
  <p><strong>Here is what I am trying to parse as an example:</strong></p>
  
  <pre><code>{"companies"=&gt;[{"city"=&gt;"San Mateo", "name"=&gt;"Jigsaw", "address"=&gt;"777 Mariners Island Blvd Ste 400", "zip"=&gt;"94404-5059", "country"=&gt;"USA", "companyId"=&gt;4427170, "activeContacts"=&gt;168, "graveyarded"=&gt;false, "state"=&gt;"CA"}], "totalHits"=&gt;1}
  </code></pre>
  
  <p>I want to access the individual elements under companies....like city and name.</p>