Skip to content

class Athena::Console::Question::MultipleChoice(T)
inherits Athena::Console::Question::AbstractChoice #

Similar to ACON::Question::Choice, but allows for more than one answer to be selected. This question accepts a comma separated list of answers.

question = ACON::Question::MultipleChoice.new "What is your favorite color?", {"red", "blue", "green"}
answer = helper.ask input, output, question

This question is also similar to ACON::Question::Choice in that you can provide either the index, key, or value of the choice. For example submitting green,0 would result in ["green", "red"] as the value of answer.

Constructors#

.new(question : String, choices : Hash(String | Int32, T), default : T | Nil = nil)#

View source

.new(question : String, choices : Indexable(T), default : Int | T | Nil = nil)#

View source