Created
May 28, 2020 19:12
-
-
Save leandro/f648b68a1a8d474079ec4f7a51ab836c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Autor do | |
def novo(nome, _) when nome in [nil, ""], do: {:error, "nome não pode ser vazio"} | |
def novo(_, email) when email in [nil, ""], do: {:error, "email não pode ser vazio"} | |
def novo(nome, email), do: {:ok, %{nome: nome, email: email}} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment