Is there a concise way to do it?
case 1
File.open(infile, 'r').readlines.each do |line|
process
end
case 2
ARGF.readlines.each do |line|
process
end
Is there a concise way to do it?
case 1
File.open(infile, 'r').readlines.each do |line|
process
end
case 2
ARGF.readlines.each do |line|
process
end
Is this what you're looking for?
method = something_to_help_me_decide ? File.open(infile, 'r') : ARGF
method.readlines.each do |line|
process
end
Not super clear what you're going for here.