title: Converting array of key value pairs to hash in Ruby
body: <p>I have some key-value pair strings in an array:</p>
  <pre><code>array = [ &quot;Name = abc&quot;, &quot;Id = 123&quot;, &quot;Interest = Rock Climbing&quot; ]
  </code></pre>
  <p>I need to convert it to a hash:</p>
  <pre><code>hash = { &quot;Name&quot; =&gt; &quot;abc&quot;, &quot;Id&quot; =&gt; &quot;123&quot;, &quot;Interest&quot; =&gt; &quot;Rock Climbing&quot; }
  </code></pre>
  <p>I must be doing something wrong because I'm getting weird mappings with my <code>.shift.split</code> resulting in <code>{&quot;Name=abc&quot;=&gt;&quot;Id=123&quot;}</code>.</p>