Last active
October 25, 2018 12:43
-
-
Save leandrocp/01b3bcd443fd7933746a2ca745def960 to your computer and use it in GitHub Desktop.
art_bc_support_specs.ex
This file contains 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 Support do | |
@type customer :: %{id: integer, last_ticket_id: integer} | |
@spec get_customer(integer) :: {:ok, customer} | {:error, binary} | |
def get_customer(customer_id) when is_integet(customer_id) do | |
# your logic here ... | |
# return the common pattern {:ok, data} or {:error, data} | |
{:ok, customer} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment