- Notifications
You must be signed in to change notification settings - Fork0
JohnJocoo/to_atom_in
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Small utility to safely convert strings to a limited set of atoms.
requireTAITAI.to_atom_in("world",[:hello,:world]):world
importTAIto_atom_in("world",~w(hello world)a):world
importTAIto_atom_in("three",~w(one two)a)# ** (ArgumentError) The atom three is not in the [:one, :two]
The package can be installedby addingto_atom_in
to your list of dependencies inmix.exs
:
defdepsdo[{:to_atom_in,"~> 0.1.0"}]end
The docs canbe found athttps://hexdocs.pm/to_atom_in.