Subject: Re: Iterator Fu Failing Me
From: "jwesley" <justin.w.smith gmail.com>
Date: Mon, 9 Jan 2006 09:58:01 +0900
References: 174641
In-reply-to: 174641
Perhaps I'm missing the point, but wouldn't the following work: (?)
elements = tokens.map do |token|
val = nil
[ClassA, ClassB, ClassC].find { |kind| val = kind.parse?(token) }
val
end
Justin