From: Marcel Ward Date: 2006-10-30T04:13:25+09:00 Subject: Re: !x.include? y On 29/10/06, Giles Bowkett wrote: > ... > list.reject! {|thing| not list_of_acceptable_values.include? thing.attribute} > > is there a nicer way to do it? You could modify the Array class to include an accept! method that does the opposite of reject! (I'm sure someone else will chime in if this is wrong or bad practise!) class Array def accept! delete_if {|item| not yield item} end end -- Marcel