Last active
August 21, 2022 14:36
-
-
Save nallwhy/3858c75f89b5266ad3239d14213f09a5 to your computer and use it in GitHub Desktop.
Definject with no do case
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 DefinjectPlayground do | |
import Definject | |
# definject hello(who, opts \\ []) | |
# definject hello(name_list, _opts) when is_list(name_list), do: name_list |> Enum.map(& "Hello, #{&1}") | |
# definject hello(name, _opts) when is_binary(name), do: "Hello, #{name}" | |
def hello(who, opts \\ []) | |
def hello(name_list, _opts) when is_list(name_list), do: name_list |> Enum.map(& "Hello, #{&1}") | |
def hello(name, _opts) when is_binary(name), do: "Hello, #{name}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment