View Source ExPropriate (ExPropriate v0.1.0)

ExPropriate is an Elixir library that allows you to decide whether or not a function is public at compile time.

First you have to set up your configuration for test and any other environment you wish your functions to be expropriated in like this:

# config/test.exs
config ExPropriate,
  enable: true

It may also be useful to configure your dev environment like this, so you can test expropriated functions in console.

# config/dev.exs
config ExPropriate,
  enable: System.get_env("EXPROPRIATE_ENABLED") == "true"
EXPROPRIATE_ENABLED=true iex -S mix
iex>

Once your config is setup, you can start using ExPropriate in your modules. There are two ways in which it can be used: