How to add a message to next if statement in ruby

Viewed 812

How to combine next with puts "#{web_url.status[0].to_i} together and display it in console but only if if part is true.

tried:
next if ... && puts "{web_url.status[0].to_i}"



  web_url  = open(url, :proxy => BaseParser::PROXY, "User-Agent" => BaseParser.rand_ua_string() )

  next if web_url.nil?
  next if web_url.status[0].to_i == 410
  next if web_url.status[0].to_i == 310
  next if web_url.status[0].to_i == 404
  next if web_url.status[0].to_i == 530
1 Answers
Related