title: Using map to format JSON
body: <p>I'm somewhat new to Ruby and I'm working on a dashboard application using Dashing.io and I have some JSON data that, after doing <code>JSON.parse</code> on it, currently looks like this:</p>
  
  <pre><code>{"location"=&gt;"Madison Central", "Members"=&gt;{"Mike"=&gt;"Minecraft crafting", "Dave"=&gt;"3D printing"}}
  </code></pre>
  
  <p>What I need to do now is to map the content in <code>"Members"</code> so that it looks like the following:</p>
  
  <pre><code>{:label =&gt; "Mike", :value=&gt; "Minecraft crafting"}
  {:label =&gt; "Dave", :value=&gt; "3D printing"}
  </code></pre>
  
  <p>I tried using <code>map</code> as follows:</p>
  
  <pre><code>event_data = response.map{|who,status| {label: who, value: status} }
  </code></pre>
  
  <p>but it outputs (predictably) wrongly:</p>
  
  <pre><code>{:label=&gt;"location", :value=&gt;"Madison Central"}
  {:label=&gt;"Members", :value=&gt;{"Mike"=&gt;"Minecraft crafting", "Dave"=&gt;"3D printing"}}
  </code></pre>
  
  <p>How to I get to just what I need in the "Members" array in the JSON?</p>