Athena::Console::Question::AbstractChoice(T, ChoiceType)
Inherits Athena::Console::Question::Base / Reference / Object
Base type of choice based questions. See each subclass for more information.
Constructors
new(question : String, choices : Indexable(T), default : Int | T | Nil = nil)
Sourcenew(question : String, choices : Hash(String | Int32, T), default : T | Nil = nil)
SourceInstance methods
error_message=(error_message : String) : self
Sourceprompt
Returns/sets the prompt to use for the question. The prompt being the character(s) before the user input.
prompt=(prompt : String)
Returns/sets the prompt to use for the question. The prompt being the character(s) before the user input.
validator
Sets the validator callback to the provided block. See [Validating the Answer][Athena::Console::Question--validating-the-answer].
validator=(validator : Proc(T | Nil, ChoiceType) | Nil)
See [Validating the Answer][Athena::Console::Question--validating-the-answer].