From: Robert Klemme Date: 2006-01-05T17:22:59+09:00 Subject: Re: Question on iterating a hash Ryan Leavengood wrote: > On 1/4/06, phil swenson wrote: >> >> Yeah, i can just iterate the keys... but it seems like there is a >> "ruby" way to do this. Any thoughts? > > Another option: > > h.map{|k,v| k if v=='1'}.compact > > And of course an inject version: > h.inject([]){|a,b| a<