From: Giles Bowkett Date: 2006-10-31T07:49:20+09:00 Subject: Re: !x.include? y On 10/29/06, dblack@wobblini.net wrote: > Hi -- > > On Mon, 30 Oct 2006, Vincent Fourmond wrote: > > > Giles Bowkett wrote: > > > >> list.reject! {|thing| not list_of_acceptable_values.include? > >> thing.attribute} > >> > >> is there a nicer way to do it? > > > > list.select {|thing| list_of_acceptable_values.include? thing.attribute > > } ?? > > > > But then you need to reassign list, since I don't know of any select! > > This would be a nice use for delete_unless. Cheers, I didn't know about delete_unless. (I did find delete_if.) -- Giles Bowkett http://www.gilesgoatboy.org