diff options
Diffstat (limited to 'lib/exdatadog/config.ex')
-rw-r--r-- | lib/exdatadog/config.ex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/exdatadog/config.ex b/lib/exdatadog/config.ex new file mode 100644 index 0000000..f686309 --- /dev/null +++ b/lib/exdatadog/config.ex @@ -0,0 +1,15 @@ +defmodule Exdatadog.Config do + @moduledoc """ + Provides helper functions for interacting with Application variables + """ + + def get_env_var(app, key, default \\ nil) do + app + |> Application.get_env(key, default) + |> case do + {:system, env_key} -> System.get_env(env_key) + env_var -> env_var + end + end + +end |