module Athena::Console::Question::Base(T)
Overview
Common logic shared between all question types. See each type for more information.
Direct including types
Defined in:
question/base.crConstructors
Instance Method Summary
-
#default : T
Returns the default value if no valid input is provided.
-
#hidden=(hidden : Bool) : self
Sets if the answer should be hidden.
-
#hidden? : Bool
Returns the answer should be hidden.
-
#hidden_fallback=(hidden_fallback : Bool)
If hidden questions should fallback on making the response visible if it was unable to be hidden.
-
#hidden_fallback? : Bool
If hidden questions should fallback on making the response visible if it was unable to be hidden.
-
#max_attempts : Int32 | Nil
Returns how many attempts the user has to enter a valid value when a
#validator
is set. -
#max_attempts=(attempts : Int32 | Nil) : self
Allow at most attempts for the user to enter a valid value when a
#validator
is set. -
#multi_line=(multi_line : Bool)
If multi line text should be allowed in the response.
-
#multi_line? : Bool
If multi line text should be allowed in the response.
-
#normalizer : Proc(T | String, T) | Nil
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
-
#normalizer(&normalizer : T | String -> T) : Nil
Sets the normalizer callback to this block.
-
#normalizer=(normalizer : Proc(T | String, T) | Nil)
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
-
#question : String
Returns the question that should be asked.
-
#trimmable=(trimmable : Bool)
Returns/sets if the answer value should be automatically trimmed.
-
#trimmable? : Bool
Returns/sets if the answer value should be automatically trimmed.
Constructor Detail
Instance Method Detail
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].
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].
If multi line text should be allowed in the response. See [Multiline Input][Athena::Console::Question--multiline-input].
If multi line text should be allowed in the response. See [Multiline Input][Athena::Console::Question--multiline-input].
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
Sets the normalizer callback to this block. See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
See [Normalizing the Answer][Athena::Console::Question--normalizing-the-answer].
Returns/sets if the answer value should be automatically trimmed. See [Trimming the Answer][Athena::Console::Question--trimming-the-answer].