avrora v0.7.1 Avrora.Mapper View Source

Functions to convert between common Elixir structures and erlavro structures.

Link to this section Summary

Functions

Convert tuple-based structure returned by erlavro to Elixir map.

Link to this section Functions

Link to this function

to_map(value)

View Source
to_map(term()) :: term()

Convert tuple-based structure returned by erlavro to Elixir map.

Examples

iex> map = Avrora.Mapper.to_map([{:a, 1}, {"b", [nil, 11.1, "three"]}, {:c, [{:hello, "world"}]}])
iex> %{"a" => a, "b" => b, "c" => c} = map
iex> a
1
iex> b
[nil, 11.1, "three"]
iex> c
%{"hello" => "world"}