I have one hash
h1 = {"Cust1"=>500, "Cust4"=>400, "Cust2"=>100, "Cust3"=>100}
I want to insert this hash into a CSV file with the ranking of keys according to their value.
The sample output should look like this
ID,Sales,Rank Cust1,500,1 Cust4,400,2 Cust2,100,3 Cust3,100,3
I have to write the program in Ruby.
You can use
each_with_index
method of hashCode for CSV