Class: AnywayAppConfig::Loaders::EnvYAML

Inherits:
Anyway::Loaders::YAML
  • Object
show all
Defined in:
lib/anyway_app_config/loaders/env_yaml.rb

Overview

YAML loader that always reads the section matching ‘Anyway::Settings.current_environment`, regardless of file content or global detection. Raises if the current environment is not set.

Instance Method Summary collapse

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
# File 'lib/anyway_app_config/loaders/env_yaml.rb', line 11

def call(**)
  if ::Anyway::Settings.current_environment.nil?
    raise ArgumentError,
          'Anyway::Settings.current_environment must be set to use the :env_yml loader'
  end

  super
end