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

Introduce all/0 and validate/1 #2

Open
HarshBalyan opened this issue Dec 8, 2021 · 0 comments
Open

Introduce all/0 and validate/1 #2

HarshBalyan opened this issue Dec 8, 2021 · 0 comments

Comments

@HarshBalyan
Copy link

HarshBalyan commented Dec 8, 2021

For each constant declared using defconst we can have the following functions

  • @spec values() :: list(String.t())
    • returns list of values
      e.g. for defconst(p: "P", i: "I")
      it returns ["P", "I"]
  • @spec validate(String.t()) :: {:ok, String.t()} | {:error, String.t()}
    • returns {:ok , value} for a valid value.
    • returns {:error, msg} for an invalid value
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