-
-
Save magnusstahre/2582841 to your computer and use it in GitHub Desktop.
Stuff I'm doing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def good_or_bad lines, patterns | |
lines.zip(patterns).all? { |(line, pattern)| | |
line.match pattern | |
} | |
end | |
lines = [ "line1", "line2", "line3" ] | |
patterns = [ "pattern1", "pattern2", "pattern3" ] | |
puts lines.zip patterns #=> [["line1", "pattern1"], ["line2", "pattern2"], ["line3", "pattern3"]] | |
good_or_bad lines, patterns #=> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment