docs: improve the smokestack moduledoc to elaborate about templates.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cf5565e2a4
commit
d6dad83013
1 changed files with 8 additions and 0 deletions
|
@ -26,6 +26,14 @@ defmodule Smokestack do
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Templates
|
||||||
|
|
||||||
|
Each attribute uses a template to generate a value when building a factory.
|
||||||
|
Templates can be anything that implements the `Smokestack.Template` protocol.
|
||||||
|
This protocol is automatically implemented for functions with arities zero
|
||||||
|
through two - meaning you can just drop in your own functions - or use one of
|
||||||
|
the built-in helpers from `Smokestack.Dsl.Template`.
|
||||||
|
|
||||||
## Variants
|
## Variants
|
||||||
|
|
||||||
Sometimes you need to make slightly different factories to build a resource
|
Sometimes you need to make slightly different factories to build a resource
|
||||||
|
|
Loading…
Reference in a new issue