From: Trans Date: 2007-11-25T15:00:17+09:00 Subject: Re: Enumerable#detect_result ? On Nov 24, 5:12 pm, Yossef Mendelssohn wrote: > Actual code from a recent project: > > # This is bunk, but I'm tired and can't think of the right way to > do this > # I was trying formats.detect, but that just returns the format, > not the result > result = nil > formats.each do |f| > result = f.process(mesg) > break if result > end A little better. result = nil formats.find do |f| result = f.process(mesg) end T.