title: Convert sorted Ruby array to ranks with possible repeats
body: <p>I have the the following array of numbers in Ruby (higher is better), and I'd like to rank them. In other words, I want to convert the following sorted list:</p>
  
  <pre><code>[89 52 52 36 18 18 5]
  </code></pre>
  
  <p>to the following ranks:</p>
  
  <pre><code>[1 2 2 4 5 5 7]
  </code></pre>
  
  <p>For instance, the winner gets first place, there's a tie for second place, and so on. The important point, obviously, is that ties are possible and those ties must then skip the corresponding ranks. Any number of ties might be possible (3 people sharing second place).</p>
  
  <p>Is there an elegant way to perform this kind of operation?</p>