title: compare input to fields in a json file in ruby
body: <p>I am trying to create a function that takes an input.  Which in this case is a tracking code.  Look that tracking code up in a JSON file then return the tracking code as output. The json file is as follows:</p>
  
  <pre><code>[
    {
      "tracking_number": "IN175417577",
      "status": "IN_TRANSIT",
      "address": "237 Pentonville Road, N1 9NG"
    },
    {
      "tracking_number": "IN175417578",
      "status": "NOT_DISPATCHED",
      "address": "Holly House, Dale Road, Coalbrookdale, TF8 7DT"
    },
    {
      "tracking_number": "IN175417579",
      "status": "DELIVERED",
      "address": "Number 10 Downing Street, London, SW1A 2AA"
    }
  ]
  </code></pre>
  
  <p>I have started using this function:</p>
  
  <pre><code>def compare_content(tracking_number)
    File.open("pages/tracking_number.json", "r") do |file|
    file.print()
  end
  </code></pre>
  
  <p>Not sure how I would compare the input to the json file. Any help would be much appreciated.</p>