# `Mediate.Answer`
[🔗](https://github.com/mrmeku/mediate/blob/v0.1.0/lib/mediate/answer.ex#L1)

What a decider answers for one subject, operation, and object. It holds
the verdict, the reason in one word, the version of the rules that gave
it, and `meta`.

`meta` belongs to the decider. What only one decider can say travels
there, so the reason stays a word every decider shares. A decider that
sets one of these keys gives it this value:

| Key | Value |
|---|---|
| `:rule` | The rule, clause, policy, or relation the verdict came from |
| `:matched` | The rules, clauses, or path an explanation lists |
| `:detail` | The engine's own text, where the reason is `:engine_unreachable` |
| `:kind` | The subject kind the port does not know |

# `reason`

```elixir
@type reason() ::
  :allowed
  | :deny_by_default
  | :rule_denied
  | :engine_unreachable
  | :missing_fact
  | :unknown_operation
  | :unknown_subject_kind
```

Why the verdict is what it is, in a form a record carries without an attribute value.

# `t`

```elixir
@type t() :: %Mediate.Answer{
  meta: map(),
  reason: reason(),
  verdict: verdict(),
  version: String.t() | nil
}
```

One answer: the verdict, why, the policy version that decided, and whatever the adapter puts in `meta`.

# `verdict`

```elixir
@type verdict() :: :allow | :deny
```

What the rule said about the request.

# `reasons`

```elixir
@spec reasons() :: [reason()]
```

The reasons, in the order the type lists them.

---

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