Search documentation of Plushie

# Plushie.Type.Range (Plushie v0.7.2)

Copy Markdown View Source

Validates `{min, max}` numeric range tuples.

Used by slider and progress bar widgets for the value range.

## Summary

### Types

t()

### Functions

cast(arg1)

Validates a `{min, max}` range tuple.

## Types

# t()

    @type t() :: {number(), number()}

## Functions

# cast(arg1)

    @spec cast(term()) :: {:ok, t()} | :error

Validates a `{min, max}` range tuple.

## Examples

    iex> Plushie.Type.Range.cast({0, 100})
    {:ok, {0, 100}}

    iex> Plushie.Type.Range.cast({-1.0, 1.0})
    {:ok, {-1.0, 1.0}}

    iex> Plushie.Type.Range.cast(:nope)
    :error