Acuity.Config (acuity v0.1.1)

Utility that handles interaction with the application's configuration

Link to this section Summary

Functions

In config.exs, use a string, a function or a tuple

In config.exs your implicit or expicit configuration is

Resolves the given key from the application's configuration returning the wrapped expanded value. If the value was a function it get's evaluated, if the value is a touple of three elements it gets applied.

In config.exs, use a string, a function or a tuple

Link to this section Functions

In config.exs, use a string, a function or a tuple:

config :acuity, api_key: System.get_env("ACUITY_API_KEY")

or:

config :acuity, api_key: {:system, "ACUITY_API_KEY"}

or:

config :acuity, api_key: {MyApp.Config, :acuity_api_key, []}
@spec json_library() :: module()

In config.exs your implicit or expicit configuration is:

config :acuity, json_library: Poison # defaults to Jason but can be configured to Poison
Link to this function

resolve(key, default \\ nil)

@spec resolve(atom(), any()) :: any()

Resolves the given key from the application's configuration returning the wrapped expanded value. If the value was a function it get's evaluated, if the value is a touple of three elements it gets applied.

In config.exs, use a string, a function or a tuple:

config :acuity, user_id: System.get_env("ACUITY_USER_ID")

or:

config :acuity, user_id: {:system, "ACUITY_USER_ID"}

or:

config :acuity, user_id: {MyApp.Config, :acuity_user_id, []}