From: RichardOnRails Date: 2011-05-29T05:35:26+09:00 Subject: Re: Problem in using %:whatever in enumumerations On May 28, 3:08 pm, Christopher Dicely wrote: > module Enumerable > def all_have?(attribute, value) > all? { |item| item.__send__(attribute) == value } > end > end > > greek.all_have? :length, 5 Hi Christopher, Philosophically, that's just the kind of thing I wanted (dynamic application of criteria) but didn't have the wit to describe it. As you saw in my post, I had the statement: puts greek.all? { |s| s.length == 5 } But if I had a number of criteria and values to apply, my code would get messy fast and invite copy & paste errors. Your code is tidy, more readable and can be made as short as I wish without loss of clarity. Many thanks, Richard