class

Athena::Console::Question::MultipleChoice(T)

Inherits Athena::Console::Question::AbstractChoice / Athena::Console::Question::Base / Reference / Object

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"}

helper = self.helper ACON::Helper::Question
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)
Source
new(question : String, choices : Indexable(T), default : Int | T | Nil = nil)
Source