next if value.includes?(nil)
next if value.includes?(msg[key]?)
Why not use: next if value.includes?(nil) || value.includes?(msg[key]?)
As an array name, "value" may be confused.
Thanks, RenWen
end return true endreturn false unless regular_match(value, msg[key]?.to_s)
- private def regular_match(rules, string)
- rules.each do |rule|
return true if string =~ /#{rule}/
- end
- return false
- end
end
2.23.0