Gestalt.Macros (gestalt v2.0.1)

Copy Markdown View Source

Provides macros that execute Gestalt code only in the :test Mix environment. In other environments, Gestalt is compiled out and either Application or System is used.

Usage

defmodule MyApp.Config do
  use Gestalt

  def config_value(),
    do: gestalt_config(:my_app, :config, self())

  def env_value(),
    do: gestalt_env("ENVIRONMENT_VARIABLE", self())
end

Summary

Functions

gestalt_config(module, key, pid)

(macro)
@spec gestalt_config(module(), atom(), pid()) :: Macro.t()

gestalt_env(variable, pid)

(macro)
@spec gestalt_env(binary(), pid()) :: Macro.t()