Transmog v0.1.1 API Reference

Modules

Transmog is a module which provides the ability to map keys on nested maps, lists and structs to new values. It is useful for when you have external data that you want to convert into an internal format easily. This recursive transformation is made using an internal concept known as key pairs.

Transmog.KeyPairs is a struct which holds the information about a list of key_pair/0 and ensures that they are valid. A key pair is a list of mappings from one path to another. For example, {[:a], [:b]} indicates that we are transforming a map with keys :a and :b to now have the keys swapped with the same values.

Transmog.Parser defines how to parse a single key path. Parsing a key path means to transform it into a list which defines how to reach the target value in the nested map or list.

Exceptions