次のようなハッシュがあるとします。
foo = {
:bar => ['r', 'baz'], # has a total str length of 4 characters inside of the array
:baz => ['words', 'etc', 'long words'] # has a total str length of 18 characters inside of the array,
:blah => ['at'] # has a total str length of 2 characters inside of the array
# etc...
}
配列に含まれるアイテムの文字列の合計の長さでこのハッシュを並べ替えるにはどうすればよいですか?この場合の結果のハッシュ順序は次のようになります。:blah, :bar, :baz