From: Simon Strandgaard Date: 2005-12-02T08:11:35+09:00 Subject: Re: Help constructing interesting hash? On 11/30/05, Chris McMahon wrote: [snip] > I can easily make a hash (using each_with_index) where one value is > the lookup value for the other value: #invert can sometimes be useful.. but not in this case Hash[*%w(a b c).zip([1, 2, 2]).flatten].invert #=> {1=>"a", 2=>"c"} -- Simon Strandgaard