# `Monty.Frameworks.Actions.ActionJSONEncoder`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/frameworks/actions/action_json_encoder.ex#L1)

An action as the map it crosses a boundary as.

Mirrors `tbp/monty/frameworks/actions/actions.py::ActionJSONEncoder`, which is
a `JSONEncoder` subclass whose only job is `dict(action)`. The JSON library is
not this module's business — `Jason.encode!/1` on the map it answers is the
same object Monty produces — so what is ported here is the value mapping, not
the encoder plumbing.

# `encode`

```elixir
@spec encode(Monty.Frameworks.Actions.Action.t()) :: map()
```

The action as a map: its name under `"action"`, then every parameter.

A tuple is not JSON, and the two pose actions carry their rotation as one
`{w, x, y, z}` — Monty's `quaternion` crosses its boundary as those four
numbers, so they cross this one as a list.

---

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