docs: improve the smokestack moduledoc to elaborate about templates.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
James Harton 2023-09-09 20:35:53 +12:00
parent cf5565e2a4
commit d6dad83013
Signed by: james
GPG key ID: 90E82DAA13F624F4

View file

@ -26,6 +26,14 @@ defmodule Smokestack do
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
Sometimes you need to make slightly different factories to build a resource