# `AshGrant.PolicyTest.DslGenerator`
[🔗](https://github.com/jhlee111/ash_grant/blob/v0.14.1/lib/ash_grant/policy_test/dsl_generator.ex#L1)

Generates Elixir DSL code from YAML policy test files.

This allows converting YAML policy tests to Elixir DSL for:
- Importing tests from external tools
- Converting documentation to executable tests
- Migrating from YAML to DSL format

## Examples

    code = DslGenerator.generate("policy_tests/document.yaml")
    File.write!("test/policy_tests/document_test.exs", code)

# `generate`

```elixir
@spec generate(String.t()) :: String.t()
```

Generates Elixir DSL code from a YAML file.

# `generate_from_parsed`

```elixir
@spec generate_from_parsed(map(), String.t() | nil) :: String.t()
```

Generates Elixir DSL code from parsed YAML data.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
