Creating a hash inside an array that contains hashes
<p>Let me preface this by saying I am just starting to learn ruby...</p>

<p>I have any array that is made of hashes, and arrays nested within each other. It looks like this:</p>

<pre><code> people =
[
  {
    "John Doe" =&gt; {
      "phone" =&gt; "555-555-555",
      "company" =&gt; "Company name",
      "children" =&gt; [
        "John",
        "Jane",
        "Annamarie"
      ]
    },
    "Jane Smith" =&gt; {
      "phone" =&gt; "555-555-5555",
      "company" =&gt; "company name",
      "children" =&gt; [
        "Steven"
      ]
    }
  }
]
</code></pre>

<p>How would I go about adding a new hash where the name of the person acts as a key, and the new hash is the value? E.g. I want to add "spouse" so the hash would look like this:</p>

<pre><code>people =
[
  {
    "John Doe" =&gt; {
      "phone" =&gt; "555-555-555",
      "company" =&gt; "Company name",
      "children" =&gt; [
        "John",
        "Jane",
        "Annamarie"
      ],
      "spouse" =&gt; "Jane Doe"
    },
    "Jane Smith" =&gt; {
      "phone" =&gt; "555-555-5555",
      "company" =&gt; "company name",
      "children" =&gt; [
        "Steven"
      ],
      "spouse" =&gt; "John Smith"
    }
  }
]
</code></pre>