Поток управления / Прерывание потока управления

firstMatchValue = -1
array1 = [123]
array2 = [234]

catch (:donedo
     for i in array1
         for n in array2
             if i == n
                firstMatchValue = i
                throw :done
            end
        end
    end
end
# firstMatchValue is 2
puts firstMatchValue