I'm working with an array of OpenStruct objects which looks like this:
a=[<OpenStruct name="test1", x="6", id="1">,<OpenStruct name="test2", x="5", id="2"><OpenStruct name="test1", x="8", id="3">...] I would like to group the OpenStruct objects having the same name, something like this:
a=[<OpenStruct name="test1",x=["6","8"], id=["1","3"]>,<OpenStruct name="test2", x="5", id="2">] How can I do that?
groupBy? It seems useful :-)groupBygroups the elements, not their attributes.