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
endUsed from transition/2, back/2, paginate/2 and truncate/2 inside
use Ussd.State.
Summary
Functions
Whether actual (the caller's raw input) satisfies this decision.
Types
@type t() :: term()
All the types that implement this protocol.