title: Indexing into JSON
body: <p>This seems like it should be a very easy question but I'm having some trouble with it.  I'm creating my own JSON and I need to index into it in order to seed by database.  I've indexed into JSONs before with very little difficulty, but for some reason I can't index into my own.  That makes me think that there might be an issue with my JSON itself, but I can't see anything that would cause an issue.  I appreciate your assistance!</p>
  
  <p>My JSON:</p>
  
  <pre><code>{
      "workouts": [
          {
              "level": "1",
              "exercises": [
                  {
                      "name": "box jumps",
                      "difficulty": "3",
                      "reps": "10",
                      "sets": "3",
                      "requirements": [
                          "sturdy box at least two feet high"
                      ],
                      "body-part": "quadriceps",
                      "description": "Plant both feet should length apart and jump onto the box. Once on the box, stand fully upright.",
                      "pounds": "1"
                  },
                  {
                      "name": "v-press",
                      "difficulty": "4",
                      "reps": "12",
                      "sets": "3",
                      "requirements": [
                          "mat"
                      ],
                      "body-part": "abdominals",
                      "description": "Lie flat on the ground, then raise your legs and arms slightly off the matt.",
                      "pounds": "1"
                  }
              ]
          },
          {
              "level": "2",
              "exercises": [
                  {
                      "name": "assisted pullups",
                      "difficulty": "1",
                      "reps": "12",
                      "sets": "3",
                      "requirements": [
                          "Assisted Pullup Machine"
                      ],
                      "body-part": "biceps",
                      "description": "Kneel on the machine and adjust the weight to your needs",
                      "pounds": "50"
                  },
                  {
                      "name": "assisted dips",
                      "difficulty": "1",
                      "reps": "12",
                      "sets": "3",
                      "requirements": [
                          "Assisted Dips Machine"
                      ],
                      "body-part": "triceps",
                      "description": "Kneel on the machine and adjust the weight to your needs",
                      "pounds": "50"
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>In pry, I do the following: </p>
  
  <pre><code>require "json"
  f= File.open("workout.json")
  mylist = JSON.parse(f.read)
  </code></pre>
  
  <p>When I try to index in, I get various errors (syntax error, no method errors, nil). Below are some examples of indexing I have attempted. </p>
  
  <pre><code>mylist.workouts
  mylist[:workouts]
  mylist[0]
  mylist[:workouts][0][:level]
  </code></pre>
  
  <p>Thanks in advance!</p>