# `Lemma.RuleResult`
[🔗](https://github.com/lemma/lemma/blob/main/lib/lemma/rule_result.ex#L1)

One rule result from `Lemma.run/3`, as returned in `Lemma.Response.results`.

Value fields (`measure`, `ratio`, `number`, …) mirror the flattened Rust
`RuleResultValue`. `explanation` is the raw explanation JSON map when present
(tagged by `"type"`); pattern-match on that tag directly.

# `t`

```elixir
@type t() :: %Lemma.RuleResult{
  boolean: boolean() | nil,
  calendar: map() | nil,
  date: String.t() | nil,
  display: String.t() | nil,
  explanation: map() | nil,
  measure: %{optional(String.t()) =&gt; String.t()} | nil,
  missing_data: [String.t()] | nil,
  number: String.t() | nil,
  range: map() | nil,
  ratio: %{optional(String.t()) =&gt; String.t()} | nil,
  rule_type: String.t(),
  text: String.t() | nil,
  time: String.t() | nil,
  veto_reason: String.t() | nil,
  vetoed: boolean()
}
```

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Builds a `Lemma.RuleResult` from one value of the decoded `Lemma.run/3` JSON
`"results"` map. Optional fields are absent (not `null`) from the API JSON when
unset; `Map.get/3` yields `nil` for those.

---

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