Packages

Elixir library to inflect Russian first, last, and middle names.

Current section

Files

Jump to
petrovich_elixir lib petrovich config.ex
Raw

lib/petrovich/config.ex

defmodule Petrovich.Config do
@moduledoc """
Provides application/system environment variable lookup at runtime
"""
@doc """
Returns the requested variable from application's environment.
"""
@spec get_env(atom, atom, atom | map) :: term
def get_env(application, key, default \\ nil) do
application
|> Application.get_env(key, default)
|> _get_env()
end
defp _get_env({:system, env_variable}), do: System.get_env(env_variable)
defp _get_env(value), do: value
end