This file contains hidden or 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 Gifnoc.Config do | |
| @spec get(atom, atom, term | nil) :: term | |
| def get(app, key, default \\ nil) when is_atom(app) and is_atom(key) do | |
| case read_config(Application.get_env(app, key)) do | |
| nil -> default | |
| val -> val | |
| end | |
| end | |
| def read_config({:system, var_name}), do: System.get_env(var_name) |
OlderNewer