It is very common to want to be able to configure a library based on the
runtime environment. For instance, use the mangopay sandbox in staging,
but not in production.
By using a module attribute to store the configuration in the module, we
bind it to a compile-time value.
This commit removes the module variable, calling
Application.fetch_env!/2 every time we build a url. This should not
impact performance (this call is very cheap), and lets clients of the
library set whatever value they want at runtime.
It is very common to want to be able to configure a library based on the runtime environment. For instance, use the mangopay sandbox in staging, but not in production.
By using a module attribute to store the configuration in the module, we bind it to a compile-time value.
This commit removes the module variable, calling
Application.fetch_env!/2
every time we build a url. This should not impact performance (this call is very cheap), and lets clients of the library set whatever value they want at runtime.