Closed esotericpig closed 1 year ago
If you do this, no validation happens:
ask('Letter a, b, or c? ') { |q| q.in = %w[ a b c ] }
You can enter in d, and it accepts the input.
d
In order for it to work, you have to pass in String:
String
ask('Letter a, b, or c? ',String) { |q| q.in = %w[ a b c ] }
Is there another way I should do this (I don't want a full-blown menu like with choose)? Else, I think it'd be useful to change it.
choose
If you do this, no validation happens:
You can enter in
d
, and it accepts the input.In order for it to work, you have to pass in
String
:Is there another way I should do this (I don't want a full-blown menu like with
choose
)? Else, I think it'd be useful to change it.