Subject: Re: compact or uniq that takes a block like sort?
From: "Pit Capitain" <pit.capitain gmail.com>
Date: Mon, 7 Jan 2008 21:15:21 +0900
References: 286440
In-reply-to: 286440
2008/1/7, Bil Kleb <Bil.Kleb / nasa.gov>:
> I'm looking for an elegant way to do the following:
> (...)
Bil, this makes the test pass:
class Array
def consolidate
Hash[*flatten].sort
end
end
Regards,
Pit