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

Auto define enum variants as functions #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Aug 20, 2019

  1. Add enum functions to access the potential values

    ie
    
    ```
    defenum(Color, :color, [:red, :green])
    Color.red() => :red
    ```
    zph committed Aug 20, 2019
    Configuration menu
    Copy the full SHA
    85a9099 View commit details
    Browse the repository at this point in the history
  2. Add Typescript Style Enum helpers to use EctoEnum in codebase for con…

    …stants
    
    This macro in the patch allows for using these enums inside the codebase
    to represent the same value, instead of needing to redefine them :)
    
    Thus:
    
    ```
    defenum(Status, :status, [:good, :bad, :other])
    Status.good() => :good
    ```
    zph committed Aug 20, 2019
    Configuration menu
    Copy the full SHA
    eb744a0 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2019

  1. Handle atom symbols that are invalid characters in function names

    Previously dashes in the atom would break the function definition and
    make it non-standard Elixir (ie we need valid atoms for function names).
    zph committed Aug 21, 2019
    Configuration menu
    Copy the full SHA
    b585b06 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2019

  1. Configuration menu
    Copy the full SHA
    f3359c9 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2019

  1. Merge pull request #1 from MainShayne233/add-enum-values-as-functions

    Make getters macros for pattern matching power
    zph committed Aug 30, 2019
    Configuration menu
    Copy the full SHA
    f6f18a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1f10b27 View commit details
    Browse the repository at this point in the history