title: Generate ruby classes from json document
body: <p>Consuming a ruby json API, I want to save me some work and generate ruby objects off the bat.  Any way to do this?</p>
  
  <p>so you could transform this: </p>
  
  <pre><code>{"menu": {
    "id": "file",
    "value": "File",
    "popup": {
      "menuitem": [
        {"value": "New", "onclick": "CreateNewDoc()"},
        {"value": "Open", "onclick": "OpenDoc()"},
        {"value": "Close", "onclick": "CloseDoc()"}
      ]
    }
  }}
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>class Menu
    attr_accessor :id
    attr_accessor :file
    attr_accessor :popup
  end
  </code></pre>