Module: Macmillan::Utils::Settings

Defined in:
lib/macmillan/utils/settings.rb,
lib/macmillan/utils/settings/value.rb,
lib/macmillan/utils/settings/lookup.rb,
lib/macmillan/utils/settings/key_not_found.rb,
lib/macmillan/utils/settings/app_yaml_backend.rb,
lib/macmillan/utils/settings/env_vars_backend.rb

Defined Under Namespace

Classes: AppYamlBackend, EnvVarsBackend, KeyNotFound, KeyNotFoundError, Lookup, Value

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.backendsObject

Backends must respond to the following interface:

# `.new`    :: Return an instance of the backend
# `#get key`:: Return a Value for the key.
            :: If there's no setting, return
            :: a KeyNotFound


27
28
29
# File 'lib/macmillan/utils/settings.rb', line 27

def backends
  @backends
end

Class Method Details

.instanceObject

Get an instance of the settings looker-upper



14
15
16
17
18
19
# File 'lib/macmillan/utils/settings.rb', line 14

def instance
  @instance ||= begin
    backend_instances = backends.map(&:new)
    Lookup.new(backend_instances)
  end
end