Swiss.Struct (swiss v3.12.0) View Source

A few extra functions to work with Structs.

Link to this section Summary

Functions

Converts a struct into a string-key map (eg: params from post).

Link to this section Functions

Specs

to_params_map(struct()) :: map()

Converts a struct into a string-key map (eg: params from post).

Examples

iex> Swiss.Struct.to_params_map(%Swiss.TestStruct{life: 42})
%{"life" => 42}