title: How do I skip an iteration if an IF condition becomes true, and go to the first line of do .. end?
body: <p>I wrote the following code:</p>
  
  <pre><code>require 'net/http'
  require 'uri'
  require 'IPAddr'
  require 'timeout'
  require 'Resolv'
  require 'open-uri'
  
  #puts "Origin IP:\n\n"
  #originip = gets()
  (IPAddr.new("209.85.175.120")..IPAddr.new("209.85.175.150")).each do |address|
    uri = URI("http://#{address.to_s}")
    puts "#{uri}"
    http = Net::HTTP.new(uri.host, uri.port)
    puts "#{http}"
    Net::HTTP.start(uri.host, uri.port) do |http|
      request = Net::HTTP::Get.new uri.request_uri
      response = http.request request
      if response.code == "301" || response.code == "400" then
  
      end
      #request.initialize_http_header({"Origin" =&gt; "#{originip}"})
    end
  </code></pre>
  
  <p>Is it possible to go to line <code>uri = URI("http://#{address.to_s}")</code> in my <code>if</code> condition </p>
  
  <pre><code>if response.code == "301" || response.code == "400" then
   # condition
  end
  </code></pre>
  
  <p>in the above code becomes true? How can I go to the next IP address and skip the current one if my condition becomes true?</p>
  
  <p>Is it possible to do something like  a label and <code>goto</code> statement in Ruby?</p>