def match_line regex
@line.match(regex) if !regex.is_a?(Array)
regex.each {|rgx|
results = @line.match(rgx)
return results if !results.nil?
}
return nil
end
This looks like something that could be done in a one line idiomatic way, and I'm just not seeing how.
returnbefore the second line, I suppose.