class CrConfig::Providers::EnvVarProvider
Overview
Provider that looks up configurations from environment variables
Environment variable names are downcased and _
characters get replaced by a .
. i.e. CLIENT_HOST will change into client.host .
Can optionally be constructed with a prefix that will be removed from environment variable names so it can align with the correct
configuration name.
# constructing this...
CrConfig::Providers::EnvVarProvider.new("MY_SERVER_")
# ...will cause this environment variable to be set for "client.host"
ENV["MY_SERVER_CLIENT_HOST"] = "different.example.com"
Defined in:
cr-config/abstract_provider.crConstructors
-
.new(prefix : String = "")
prefix is an optional parameter for defining the environment variable prefixes
Instance Method Summary
-
#populate(builder : AbstractBuilder)
This method gets called with the instance of the configuration builder during config building.
Instance methods inherited from class CrConfig::Providers::AbstractProvider
populate(builder : AbstractBuilder)
populate
Constructor Detail
prefix is an optional parameter for defining the environment variable prefixes
Instance Method Detail
This method gets called with the instance of the configuration builder during config building.
Use this method to populate the builder with any configuration name / values that this provider... provides