smokestack/documentation/dsls/DSL:-Smokestack.md

162 lines
2.9 KiB
Markdown

<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: Smokestack.Dsl
The DSL definition for the Smokestack DSL.
<!--- ash-hq-hide-start --> <!--- -->
## DSL Documentation
### Index
* smokestack
* factory
* attribute
### Docs
## smokestack
* [factory](#module-factory)
* attribute
---
* `:domain` (module that adopts `Ash.Domain`) - The default Ash Domain to use when evaluating loads
### factory
Define factories for a resource
* attribute
* `:domain` (module that adopts `Ash.Domain`) - The Ash Domain to use when evaluating loads
* `:resource` (module that adopts `Ash.Resource`) - Required. An Ash Resource
* `:variant` (`t:atom/0`) - The name of a factory variant The default value is `:default`.
##### attribute
* `:name` (`t:atom/0`) - Required. The name of the target attribute
* `:generator` - Required. A function which can generate an appropriate value for the attribute.œ
<!--- ash-hq-hide-stop --> <!--- -->
## smokestack
### Nested DSLs
* [factory](#smokestack-factory)
* attribute
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`domain`](#smokestack-domain){: #smokestack-domain } | `module` | | The default Ash Domain to use when evaluating loads |
## smokestack.factory
```elixir
factory resource, variant \\ :default
```
Define factories for a resource
### Nested DSLs
* [attribute](#smokestack-factory-attribute)
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`resource`](#smokestack-factory-resource){: #smokestack-factory-resource .spark-required} | `module` | | An Ash Resource |
| [`variant`](#smokestack-factory-variant){: #smokestack-factory-variant } | `atom` | `:default` | The name of a factory variant |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`domain`](#smokestack-factory-domain){: #smokestack-factory-domain } | `module` | | The Ash Domain to use when evaluating loads |
## smokestack.factory.attribute
```elixir
attribute name, generator
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#smokestack-factory-attribute-name){: #smokestack-factory-attribute-name .spark-required} | `atom` | | The name of the target attribute |
| [`generator`](#smokestack-factory-attribute-generator){: #smokestack-factory-attribute-generator .spark-required} | `(-> any) \| mfa \| (any -> any) \| mfa \| (any, any -> any) \| mfa \| Smokestack.Template.Choose \| Smokestack.Template.Constant \| Smokestack.Template.Cycle \| Smokestack.Template.NTimes \| Smokestack.Template.Sequence` | | A function which can generate an appropriate value for the attribute.œ |
### Introspection
Target: `Smokestack.Dsl.Attribute`
### Introspection
Target: `Smokestack.Dsl.Factory`
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>