# `Ussd.Decision`
[🔗](https://github.com/spesohq/ussd/blob/main/lib/ussd/decision.ex#L1)

Something that can look at the caller's raw input and say yes or no.

Implemented by every struct in `Ussd.Decisions.*`, and by anything you build
yourself - a decision is just a struct plus a `decide/2` clause, so a custom one is
as small as:

    defmodule MyApp.Decisions.EvenLength do
      defstruct []

      defimpl Ussd.Decision do
        def decide(_decision, actual), do: rem(String.length(actual), 2) == 0
      end
    end

Used from `transition/2`, `back/2`, `paginate/2` and `truncate/2` inside
`use Ussd.State`.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `decide`

```elixir
@spec decide(t(), String.t()) :: boolean()
```

Whether `actual` (the caller's raw input) satisfies this decision.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
