class

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)
Source
new(question : String, choices : Hash(String | Int32, T), default : T | Nil = nil)
Source

Instance methods

choices

Returns the possible choices.

Source
error_message

Returns the message to display if the provided answer is not a valid choice.

Source
error_message=(error_message : String) : self
Source
prompt

Returns/sets the prompt to use for the question. The prompt being the character(s) before the user input.

Source
prompt=(prompt : String)

Returns/sets the prompt to use for the question. The prompt being the character(s) before the user input.

Source
validator

See [Validating the Answer][Athena::Console::Question--validating-the-answer].

Source
validator

Sets the validator callback to the provided block. See [Validating the Answer][Athena::Console::Question--validating-the-answer].

Source
validator=(validator : Proc(T | Nil, ChoiceType) | Nil)

See [Validating the Answer][Athena::Console::Question--validating-the-answer].

Source