Simplify Prompter#prompt

This commit is contained in:
Thibault Jouan 2015-05-12 15:40:25 +00:00
parent cb5143168f
commit 86e745a3a6

View File

@ -9,8 +9,8 @@ module Producer
end
def prompt(question, choices)
cs = choices.each_with_index.inject('') do |m, (c, i)|
m += "#{i}: #{c.last}\n"
cs = choices.each_with_index.inject '' do |m, (c, i)|
m + "#{i}: #{c.last}\n"
end
output.puts "#{question}\n#{cs}Choice:"
choice = input.gets