Common logic shared between all question types.
See each type for more information.
Constructors
new(question : String, default : T)
SourceInstance methods
default
Returns the default value if no valid input is provided.
Sourcehidden=(hidden : Bool) : self
Sets if the answer should be hidden.
See [Hiding User Input][Athena::Console::Question--hiding-user-input].
Sourcehidden?
Returns the answer should be hidden.
See [Hiding User Input][Athena::Console::Question--hiding-user-input].
Sourcehidden_fallback=(hidden_fallback : Bool)
If hidden questions should fallback on making the response visible if it was unable to be hidden.
See [Hiding User Input][Athena::Console::Question--hiding-user-input].
Sourcehidden_fallback?
If hidden questions should fallback on making the response visible if it was unable to be hidden.
See [Hiding User Input][Athena::Console::Question--hiding-user-input].
Sourcemax_attempts
Returns how many attempts the user has to enter a valid value when a #validator is set.
See [Validating the Answer][Athena::Console::Question--validating-the-answer].
Sourcemax_attempts=(attempts : Int32 | Nil) : self
Allow at most attempts for the user to enter a valid value when a #validator is set.
If attempts is nil, they have an unlimited amount.
See [Validating the Answer][Athena::Console::Question--validating-the-answer].
Sourcemulti_line=(multi_line : Bool)
If multi line text should be allowed in the response.
See [Multiline Input][Athena::Console::Question--multiline-input].
Sourcemulti_line?
If multi line text should be allowed in the response.
See [Multiline Input][Athena::Console::Question--multiline-input].
Sourcenormalizer
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
Sourcenormalizer
Sets the normalizer callback to this block.
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
Sourcenormalizer=(normalizer : Proc(T | String, T) | Nil)
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
Sourcequestion
Returns the question that should be asked.
Sourcetrimmable=(trimmable : Bool)
Returns/sets if the answer value should be automatically trimmed.
See [Trimming the Answer][Athena::Console::Question--trimming-the-answer].
Sourcetrimmable?
Returns/sets if the answer value should be automatically trimmed.
See [Trimming the Answer][Athena::Console::Question--trimming-the-answer].
Source