Let's say you have a Ruby iterator that uses an external method in its block:
def external_method(n)
n.valid? ? n : next #this "next" expression will result in an error
end
(1..9).map { |i| external_method(i) }
The question really is how can you breakor next from an external method used inside an iterator.