From: Robert Dober Date: 2007-01-21T23:03:48+09:00 Subject: Re: Hash pairs at? ------=_Part_178449_20682401.1169388226439 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/21/07, gga wrote: > > > Trans ha escrito: > > Seesm like there should be a mehtod for this: > > No. > > > > > Or is there some other simple way we're supposed to do this? > > > > T. > > [:a, :c].inject({}) { |s, x| s[x] = h[x]; s } Assuming this is a frequently used idiom you'd not prefer to see h.pairs_at(:a, :c) instead of the above? Astonishes me. Cheers Robert -- "The best way to predict the future is to invent it." - Alan Kay ------=_Part_178449_20682401.1169388226439--