Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get list of enum keys or values #1

Open
synalysis opened this issue Oct 24, 2018 · 0 comments
Open

Get list of enum keys or values #1

synalysis opened this issue Oct 24, 2018 · 0 comments

Comments

@synalysis
Copy link

I'm glad I found this module since from my point of view it fills a gap in Elixir - ensure that different modules refer to the same values and don't use atoms like "magic numbers" that hopefully match.

There's just one extension I'd consider useful, for example to be used with Ecto's validate_inclusion() function. If all values (and keys) of an enum could be retrieved for an enum it would avoid the necessity to define an extra constant for this list (as shown in the sample code).

Any opinions on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant