Skip to content

Instantly share code, notes, and snippets.

@bitwalker
Forked from johnfoconnor/.conf
Last active Aug 29, 2015
Embed
What would you like to do?
my_app.complex_list.buzz.type = person
my_app.complex_list.buzz.age = 25
my_app.complex_list.fido.type = dog
my_app.complex_list.fido.age = 5
[mappings: [
"my_app.complex_list.*": [
to: "my_app.complex_list",
datatype: [complex: {"my_app.complex_list.*.type", "my_app.complex_list.*.age"}],
default: []
]
"my_app.complex_list.*.type" [
to: "my_app.complex_list",
datatype: :atom,
default: :undefined
],
"my_app.complex_list.*.age" [
to: "my_app.complex_list",
datatype: :integer,
default: 0
]]
translations: [
"my_app.complex_list.*": fn
_, {name, {type, age}}, nil -> [[name: name, type: type, age: age]]
_, {name, {type, age}}, acc -> [[name: name, type: type, age: age] | acc]
]]
[{my_app,
complex_list, [
[{name, buzz},
{type, person},
{age, 25],
[{name, fido},
{type, dog},
{age, 5}]
]}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment