dialogue.rb: Rubocop ABC fixes

This commit is contained in:
Bill Niblock 2017-10-19 00:44:41 -04:00
parent c6c9522a18
commit ce2eb89b44

View file

@ -84,16 +84,15 @@ module Dialogue
print "\n[#{valid_options}]> "
STDOUT.flush
response = STDIN.gets.chomp.to_i
response = STDIN.gets.chomp
until branch['options'].keys.include?(response) || response.zero?
print '[## Invalid options. '
print "Valid options are #{valid_options}, or 0 to exit."
print "\n[#{valid_options}]> "
response = STDIN.gets.chomp.to_i
until valid_options.include?(response) || response.to_i.zero?
print "[## Invalid options. Valid options are #{valid_options}," \
"or 0 to exit.\n[#{valid_options}]> "
response = STDIN.gets.chomp
end
response
response.to_i
end
# Check if a branch is terminal