Options

com.softinio.verdict4s.algebra.Options
See theOptions companion object
final class Options[A]

The option set of a Choice question, plus how to read the answer back.

Holds three things: the rubric map that goes on the wire, and the pair of functions that turn the service's choice string into a value of A and back. Keeping the mapping next to the keys is what lets a Choice question answer in the caller's own type rather than in raw strings.

Build one with Options.strings for options only known at runtime, or derive it from an enum (see derives Options, added alongside the typed question builders).

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Every option name, in the order they were declared.

Every option name, in the order they were declared.

Attributes

def parse(choice: String): Option[A]

Read one of the service's choice strings back into A.

Read one of the service's choice strings back into A.

Attributes

def render(value: A): OptionName

Render a value as the option name that goes on the wire.

Render a value as the option name that goes on the wire.

Attributes

def size: Int

How many options this question offers.

How many options this question offers.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Concrete fields

val keys: Keys