TypeSafeSDK.Question.Noul (TypeSafeSDK v0.2.0)

Copy Markdown View Source

Strict semantic yes/no question. new/2 returns a tuple; new!/2 raises.

iex> {:ok, q} = TypeSafeSDK.Question.Noul.new("Urgent?", true: "Time-sensitive")
iex> q.criteria
[{true, "Time-sensitive"}]

Options: :true, :false, or explicit :criteria; plus protected :extra. Do not combine explicit criteria with the true/false shorthand.

Summary

Types

t()

@type t() :: %TypeSafeSDK.Question.Noul{
  criteria: list() | nil,
  extra: map(),
  instructions: term()
}

Functions

new(instructions, opts \\ [])

@spec new(term(), keyword()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}

new!(instructions, opts \\ [])

@spec new!(term(), keyword()) :: t()