Created
August 27, 2009 05:59
-
-
Save chsh/176118 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Processor | |
BLUE_HOSTS = [ | |
'hoge.jp', 'grey.jp', 'hoge.com' | |
] | |
def process(lines) | |
lines.each do |line| | |
if blue? line | |
blue_lines << line | |
else | |
red_lines << line | |
end | |
end | |
private | |
def blue?(line) | |
blue_hosts.each do |blue_host| | |
return true if line.index(blue_host) | |
end | |
false | |
end | |
end | |
Processor.new.process(lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment