Here's what I'm doing atm:
test = {
'd' => 20,
'b' => 40,
'c' => 30,
'a' => 50,
'e' => 10
}
f = []
test.to_a.sort.each do |e|
f << e[1]
end
puts f.join(' ')
Outputs:
50 40 30 20 10
Is there a more efficient/concise/better way to do this? And before someone says so, no, I can't use an array. :p
EDIT Sorry, posted the wrong code.