TypeSafe.Choice (typesafe_ex v0.1.0)

Copy Markdown View Source

A question that selects one option from a defined set.

Build one with TypeSafe.choice/2. Options are atoms or strings and keep the order they were given in. The answer names the option with the same key, so an atom option comes back as that atom.

Summary

Types

option()

@type option() :: atom() | String.t()

t()

@type t() :: %TypeSafe.Choice{
  criteria: [{option(), TypeSafe.json() | nil}],
  instructions: TypeSafe.json()
}