module JustConfig
Overview
Let your config class (or record) extend JustConfig
to add support
for variable interpolation on yaml representations of your config.
Variables to be interpolated must appear on the right-hand side of yaml keys, e.g.
db: url: #{?DB_URL}
Defined in:
just_config.crClass Method Summary
-
.interpolate(raw_config : String, env = ENV)
Replaces any identifiers wrapped in
#{?}
occurring inraw_config
with corresponding values inenv
.
Class Method Detail
def self.interpolate(raw_config : String, env = ENV)
#
Replaces any identifiers wrapped in #{?}
occurring in raw_config
with corresponding values in env
.
Any row corresponding to unmatched identifiers in raw_config
will be removed.
raw_config
: a String in yaml format.
env
: a hash-like object.