As Ruby to complete the array (hash) by the condition?

For example, there is an array:
list = [
{ 'name': 'Аntonello', num: 3 }
{ 'name': 'Sergello', num: 5 }
{ 'name': 'Аntonello', num: 3 }
]


Here are the first and third elements of the same name, and num. How can they pick on a new array of such data have already been a number of copies (with a new count field)?
I.e., in our case it should be array:
list = [
{ 'name': 'Аntonello', count: 2 }
{ 'name': 'Sergello', count: 1 }
]
July 8th 19 at 11:52
1 answer
July 8th 19 at 11:54
learn the methods Enumerable - each, each_with_object, map and others. Without it, you move forward, will not be

Find more questions by tags RubyRuby on Rails