Skip to content

Instantly share code, notes, and snippets.

@disusered
Created June 7, 2019 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save disusered/0b10b77b3b03f7c7338688b2f03ef1b1 to your computer and use it in GitHub Desktop.
Save disusered/0b10b77b3b03f7c7338688b2f03ef1b1 to your computer and use it in GitHub Desktop.
Update ConfigLoader
defmodule Sphingi.ConfigLoader do
defp parse(value) when is_atom(value), do: value |> to_string
defp parse(value), do: value
def get(namespace, value, key \\ nil) do
if key do
parse(Application.get_env(namespace, value)[key])
else
parse(Application.get_env(namespace, value))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment