here is my code which is good
puts "Donne moi un texte :"
text = gets.chomp
words = text.split(" ")
frequencies = Hash.new(0)
words.each do |word|
frequencies = frequencies.sort_by do |word, count|
But I wanted to know if i really understand the sort_by method
for example here we are calling the sort_by on frequencies and we attribute word and count to the keys and values right ?
but the second count written is it like telling ruby to sort frequencies according to count ?