title: what is the mean of * and flatten in ruby
body: <p>I am new to ruby language so when I was trying to sort a hash by value 
  I used this method to sort:</p>
  
  <pre><code>movie_popularity.sort_by{|m,p| p}.reverse
  </code></pre>
  
  <p>but the the sort method returns an array while I need a hash to be returned so I used this command:</p>
  
  <pre><code>movie_popularity=Hash[*movie_popularity.sort_by{|m,p| p}.reverse.flatten]
  </code></pre>
  
  <p>my Question is what is the meaning of <code>*</code> and <code>flatten</code> in the above line?</p>
  
  <p>Thanks =)</p>