Packages

Elixir wrapper for Zoho CRM API. Full documentation can be found at https://www.zoho.com/crm/help/api/

Current section

Files

Jump to
zoho lib zoho utils.ex
Raw

lib/zoho/utils.ex

defmodule Zoho.Utils do
@spec safe_atomize_keys(map, list(atom)) :: map
@doc """
Return a map with all keys converted to atoms given in the list. Skips all
other atoms
"""
def safe_atomize_keys(map, safe_keys) when is_map(map) do
for safe_key <- safe_keys, into: %{} do
string_key = Atom.to_string(safe_key)
value = Map.get(map, string_key)
{ safe_key, value }
end
end
end