mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
docs: Add clarifying language around the use of the Enum module (#340)
This commit is contained in:
parent
067228980e
commit
4aac381cb1
1 changed files with 2 additions and 2 deletions
|
@ -2,14 +2,14 @@ defmodule Ash.Type.Enum do
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
A type for abstracting enums into a single type.
|
A type for abstracting enums into a single type.
|
||||||
|
|
||||||
For example, you might have:
|
For example, your existing app might look like:
|
||||||
```elixir
|
```elixir
|
||||||
attribute :status, :atom, constraints: [one_of: [:open, :closed]]
|
attribute :status, :atom, constraints: [one_of: [:open, :closed]]
|
||||||
```
|
```
|
||||||
|
|
||||||
But as that starts to spread around your system you may find that you want
|
But as that starts to spread around your system you may find that you want
|
||||||
to centralize that logic. To do that, use this module to define an Ash type
|
to centralize that logic. To do that, use this module to define an Ash type
|
||||||
easily.
|
easily:
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
defmodule MyApp.TicketStatus do
|
defmodule MyApp.TicketStatus do
|
||||||
|
|
Loading…
Reference in a new issue