Created
April 5, 2021 10:10
-
-
Save moroz/7a4a140cd3910fd2dd61101c0347c725 to your computer and use it in GitHub Desktop.
Custom Elixir guard for IDs
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 MyApp.Guards do | |
defguard is_id(id) when is_binary(id) or is_integer(id) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment