title: Sorting by a value in an object in an array in Ruby
body: <p>I have a bunch of objects in an array and would like to sort by a value that each object has. The attribute in question in each object is a numeric value.</p>
  
  <p>For example:</p>
  
  <pre><code>[[1, ..bunch of other stuff],[5, ""],[12, ""],[3, ""],]
  </code></pre>
  
  <p>would become:</p>
  
  <pre><code>[[1, ..bunch of other stuff],[3, ""],[5, ""],[12, ""],]
  </code></pre>
  
  <p>I want to sort by the numerical value stored in each of the objects.</p>
  
  <p><code>[5, 3, 4, 1, 2]</code> becomes <code>[1, 2, 3, 4, 5]</code>, however these numbers are stored inside objects.</p>