anka v0.1.0 Anka.Model behaviour View Source

Link to this section Summary

Functions

Generates an Anka.Model from keywords

Link to this section Functions

Link to this macro __using__(opts \\ []) View Source (macro)

Generates an Anka.Model from keywords.

Examples

iex> defmodule Post do
...>
...>    use Anka.Model, [
...>        meta: [
...>            singular: :post,
...>            plural: :posts,
...>        ],
...>        struct: [
...>            fields: [
...>                title: [
...>                    type: :string,
...>                ],
...>                body: [
...>                    type: :string,
...>                ],
...>            ],
...>        ],
...>    ]
...>
...> end
...>
...> Anka.Model.Interpreter.get_opt(Post, :"struct.fields.title.type")
:string

Link to this section Callbacks