From d6dad83013ec3cc00c158caa7ad7cdad53167316 Mon Sep 17 00:00:00 2001 From: James Harton Date: Sat, 9 Sep 2023 20:35:53 +1200 Subject: [PATCH] docs: improve the smokestack moduledoc to elaborate about templates. --- lib/smokestack.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/smokestack.ex b/lib/smokestack.ex index 9e9ddfd..d55b306 100644 --- a/lib/smokestack.ex +++ b/lib/smokestack.ex @@ -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