config_macro v0.1.0 ConfigMacro
Contains config/2
macro that defines module-namespaced
Application.get_env/3
getters. Supposed to complement
Mix.Config.config/3
macro.
Minimal usage example:
# lib/zelda/link.ex
defmodule Zelda.Link do
import ConfigMacro
config :zelda, health: 100, weapon: "Tree Branch"
end
# config/config.exs
use Mix.Config
config :zelda, Zelda.Link, weapon: "Kokiri Sword"
$ iex -S mix
iex(1)> Zelda.Link.health
100
iex(2)> Zelda.Link.weapon
"Kokiri Sword"
Link to this section Summary
Functions
Defines getters for the given params
Link to this section Functions
Defines getters for the given params.
app
is an atom with OTP application name.
params
is a list of atoms (for keys without default value) and/or
{:key, "default"}
tuples.