Class: PagerJudy::Sync::Config

Inherits:
ConfigMapper::ConfigStruct
  • Object
show all
Defined in:
lib/pager_judy/sync/config.rb

Overview

load and validate our configuration

Class Method Summary collapse

Class Method Details

.data_from(*sources) ⇒ Object

Load configuration data.

Includes are processed; defaults are included, references are expanded.



28
29
30
# File 'lib/pager_judy/sync/config.rb', line 28

def data_from(*sources)
  ConfigHound.load(sources, expand_refs: true, include_key: "include")
end

.from(*config_sources) ⇒ Object

Load configuration.

Multiple “sources” can be specified. First one wins. Sources may be a file-name, a URI, or a raw Ruby Hash.



18
19
20
21
22
# File 'lib/pager_judy/sync/config.rb', line 18

def from(*config_sources)
  config_data = data_from(*config_sources)
  config_data.delete("var")
  from_data(config_data)
end