title: How to sort a mixed array by different elements in Ruby?
body: <p>I have an array similar to this:</p>
  
  <pre><code>a = [
    [0, {:a=&gt;"31", :b=&gt;"21"}],
    [1, {:a=&gt;"32", :b=&gt;"11"}],
    [1, {:a=&gt;"25", :b=&gt;"19"}],
    [0, {:a=&gt;"12", :b=&gt;"10"}]
  ]
  </code></pre>
  
  <p>And I want to sort it by the first element of each row or by the various elements of the hash (2nd element in the row).</p>