Skip to content

module Athena::Console::Question::Base(T) #

Common logic shared between all question types. See each type for more information.

Direct including types

Athena::Console::Question(T) Athena::Console::Question::AbstractChoice(T, ChoiceType)

Constructors#

.new(question : String, default : T) #

View source

Methods#

#default #

Returns the default value if no valid input is provided.

View source

#hidden=(hidden : Bool) : self #

Sets if the answer should be hidden. See Hiding User Input.

View source

#hidden? #

Returns the answer should be hidden. See Hiding User Input.

View source

#hidden_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.

View source

#hidden_fallback? #

If hidden questions should fallback on making the response visible if it was unable to be hidden. See Hiding User Input.

View source

#max_attempts #

Returns how many attempts the user has to enter a valid value when a #validator is set. See Validating the Answer.

View source

#max_attempts=(attempts : Int32?) : 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.

View source

#multi_line=(multi_line : Bool) #

If multi line text should be allowed in the response. See Multiline Input.

View source

#multi_line? #

If multi line text should be allowed in the response. See Multiline Input.

View source

#normalizer #

Sets the normalizer callback to this block. See Normalizing the Answer.

View source

#normalizer=(normalizer : Proc(T | String, T)?) #

View source

#question #

Returns the question that should be asked.

View source

#trimmable=(trimmable : Bool) #

Returns/sets if the answer value should be automatically trimmed. See Trimming the Answer.

View source

#trimmable? #

Returns/sets if the answer value should be automatically trimmed. See Trimming the Answer.

View source