Terrasol.Document.Format behaviour (Terrasol v2.0.2)

View Source

Behaviour for Document handler modules

Summary

Callbacks

Build a struct from a supplied map using proper defaults

The "format" value which this module handles

Parse a map into a struct.

Callbacks

build(map)

@callback build(map()) :: map() | {:invalid, [atom()]}

Build a struct from a supplied map using proper defaults

Return {:invalid, [atoms for invalid supplied keys]}

format_string()

@callback format_string() :: String.t()

The "format" value which this module handles

parse(map)

@callback parse(map()) :: map() | {:invalid, [atom()]}

Parse a map into a struct.

Return {:invalid, [atoms for unvalidatable keys]}