title: Convert one line json into multiple lines to write to a file (Ruby)
body: <p>I've run into a situation where I'm retrieving a json string in ruby, but I'm attempting to write it to a file structured like your usual json file (for example:</p>
  
  <pre><code>{
      "top":{
          "mid1":"bot1", 
          "mid2":"bot2"
      }
  }
  </code></pre>
  
  <p>However, the way the json string is structured is like so:</p>
  
  <pre><code>{"top":{"mid1":"bot1","mid2":"bot2"}}
  </code></pre>
  
  <p>I've seen other posts mention doing JSON.parse in order to get what I want, however that just causes it to look like this:</p>
  
  <pre><code>{"top"=&gt;{"mid1"=&gt;"bot1", "mid2"=&gt;"bot2"}}
  </code></pre>
  
  <p>Is there a way that I can just convert the json string into what it looks like in the first code block above? </p>