Collection grouping/sorting question

@coll= [{:period=>{:people=>[#], :date=>Sun, 08 Feb 2009}},
{:period=>{:people=>[#, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #,
#, #], :date=>Sun, 15 Feb 2009}}, {:period=>{:people=>[#, #, #, #, #,
#, #, #, #, #, #, #, #, #], :date=>Sun, 22 Feb 2009}},
{:period=>{:people=>[#, #], :date=>Sat, 28 Feb 2009}},
{:period=>{:people=>[#, #, #, #, #, #, #], :date=>Sun, 01 Mar 2009}},
{:period=>{:people=>[#, #, #], :date=>Sun, 08 Mar 2009}},
{:period=>{:people=>[#, #, #, #, #, #], :date=>Sun, 15 Mar 2009}},
{:period=>{:people=>[#], :date=>Wed, 18 Mar 2009}},
{:period=>{:people=>[#, #, #], :date=>Sun, 22 Mar 2009}},
{:period=>{:people=>[#], :date=>Sun, 29 Mar 2009}},
{:period=>{:people=>[#, #, #, #, #, #, #, #, #, #], :date=>Sun, 05 Apr
2009}}, {:period=>{:people=>[#], :date=>Sun, 12 Apr 2009}},
{:period=>{:people=>[#, #, #, #, #, #, #, #, #, #, #], :date=>Sun, 19
Apr 2009}}, {:period=>{:people=>[#, #, #, #, #, #, #, #,
#], :date=>Sun, 26 Apr 2009}}, {:period=>{:people=>[#, #, #, #, #, #,
#, #, #, #, #, #, #, #, #, #], :date=>Sun, 03 May 2009}}]

I have the above collection of hashes. Each hash has a date and a
collection of people objects. I want to group this collection by month
according to the date attribute. What’s a good way to do this? I can’t
think…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs