From: dblack@... Date: 2006-01-05T07:04:20+09:00 Subject: Re: Question on iterating a hash Hi -- On Thu, 5 Jan 2006, 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 If you're sure nil isn't a key :-) David -- David A. Black dblack@wobblini.net "Ruby for Rails", from Manning Publications, coming April 2006! http://www.manning.com/books/black