From: MonkeeSage Date: 2007-11-25T12:20:10+09:00 Subject: Re: Enumerable#detect_result ? On Nov 24, 4:12 pm, Yossef Mendelssohn wrote: > Is there anything like Enumerable#detect_result? Is there any desire > for it? Is there any better name? Would this work? module Enumerable def detect_result(ifnone=nil, &block) self.each { |x| result = block.call(x) return result if result } if ifnone then ifnone.call else nil end end end Regards, Jordan