cocoon v0.1.0 Cocoon
Link to this section Summary
Functions
Transforms data.
Link to this section Functions
Link to this function
transform(data, mappings)
Transforms data.
Arguments
:data
- map or list of maps to transform:mappings
- list of tuple mappings
Examples
data = %{ "key" => "value" } mappings = [{ :key, ["key"] }]
%{ key: "value" } = Cocoon.transform(data, mappings)
data = %{ "key" => 7 } mappings = [{ :key, ["key"], &to_string/1 }]
%{ key: "7" } = Cocoon.transform(data, mappings)