View Source Smokestack.Dsl (smokestack v0.9.2)
The DSL definition for the Smokestack DSL.
DSL Documentation
Index
- smokestack
- factory
- after_build
- attribute
- before_build
- factory
Docs
smokestack
- factory
- after_build
- attribute
- before_build
:domain(module that adoptsAsh.Domain) - The default Ash Domain to use when evaluating loads
factory
Define factories for a resource
* after_build
* attribute
* before_build:domain(module that adoptsAsh.Domain) - The Ash Domain to use when evaluating loads:resource(module that adoptsAsh.Resource) - Required. An Ash Resource:variant(atom/0) - The name of a factory variant The default value is:default.:auto_build(one or a list ofatom/0) - A list of relationships that should always be built when building this factory The default value is[].:auto_load- An Ash "load statement" to always apply when building this factory The default value is[].
after_build
Modify the record after building.
Allows you to provide a function which can modify the built record before returning.
These hooks are only applied when building records and not parameters.
:hook(mfa or function of arity 1) - Required. A function which returns an updated record
attribute
:name(atom/0) - Required. The name of the target attribute:generator- Required. A function which can generate an appropriate value for the attribute.œ
before_build
Modify the attributes before building.
Allows you to provide a function which can modify the the attributes before building.
:hook(mfa or function of arity 1) - Required. A function which returns an updated record