Options

com.softinio.verdict4s.algebra.Options
See theOptions companion class
object Options

Building an Options set: from strings at runtime, or derived from an enum with derives Options.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Options.type

Members list

Type members

Types

The rubric map as it goes on the wire.

The rubric map as it goes on the wire.

SortedMap so the encoded JSON is deterministic, which keeps the golden tests stable and identical on the JVM and on Node. The refinement carries the API's own limit of 1 to 255 options.

Attributes

Value members

Concrete methods

inline def derived[A](using m: SumOf[A]): Options[A]

Derive an option set from a Scala 3 enum.

Derive an option set from a Scala 3 enum.

enum Dept derives Options:
 case Billing, Technical, Sales

The case labels become the option names, in declaration order, and a Choice question built from this answers in Dept rather than in strings. Use describing when the names alone are not enough of a rubric.

Only enums whose cases are all singletons can be derived: a case with parameters has no single name to send.

Attributes

inline def describing[A](rubrics: Map[String, Instructions])(using m: SumOf[A]): Options[A]

Derive from an enum, with rubric text for some or all of its cases.

Derive from an enum, with rubric text for some or all of its cases.

Attributes

An option set with no rubric text, for when the names speak for themselves.

An option set with no rubric text, for when the names speak for themselves.

Attributes

An option set whose names are only known at runtime.

An option set whose names are only known at runtime.

Value parameters

entries

option name to rubric; a None rubric is meaningful and is sent as an explicit null

Attributes

Givens

Givens

given given_Eq_Options[A]: Eq[Options[A]]