dialogue.rb: Rubocop ABC fixes
This commit is contained in:
parent
c6c9522a18
commit
ce2eb89b44
1 changed files with 6 additions and 7 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue