Method: Polars::Config.load

Defined in:
lib/polars/config.rb

.load(cfg) ⇒ Config

Load and set previously saved (or shared) Config options from json/file.

Returns:



51
52
53
54
55
56
57
58
59
60
# File 'lib/polars/config.rb', line 51

def self.load(cfg)
  options = JSON.parse(cfg)
  ENV.merge!(options["environment"])
  options.fetch("fetch", {}).each do |cfg_methodname, value|
    if POLARS_CFG_DIRECT_VARS.key?(cfg_methodname)
      public_send(cfg_methodname, value)
    end
  end
  self
end