Created
          September 3, 2015 19:52 
        
      - 
      
- 
        Save aellispierce/0c5e96315e5d6ff1bfaf to your computer and use it in GitHub Desktop. 
Revisions
- 
        aellispierce created this gist Sep 3, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ hash = {cool_peaople: 10, bananas: 30, shoes: 20, red: 14} array = hash.values.sort.reverse #returns: # 30 # 20 # 14 # 10 ordered_tuples = Array.new array.each do |value| ordered_tuples << {"#{hash.key(value)}" => "#{value }"} end puts ordered_tuples #returns: # {"bananas"=>"30"} # {"shoes"=>"20"} # {"red"=>"14"} # {"cool_peaople"=>"10"}