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}]> " print "\n[#{valid_options}]> "
STDOUT.flush STDOUT.flush
response = STDIN.gets.chomp.to_i response = STDIN.gets.chomp
until branch['options'].keys.include?(response) || response.zero? until valid_options.include?(response) || response.to_i.zero?
print '[## Invalid options. ' print "[## Invalid options. Valid options are #{valid_options}," \
print "Valid options are #{valid_options}, or 0 to exit." "or 0 to exit.\n[#{valid_options}]> "
print "\n[#{valid_options}]> " response = STDIN.gets.chomp
response = STDIN.gets.chomp.to_i
end end
response response.to_i
end end
# Check if a branch is terminal # Check if a branch is terminal