def to_environment
    to_concatenated_name_hash('_').each_with_object({}) do |pair, env_hash|
      env_hash[pair[0].upcase] = pair[1].to_s
    end
  end
def to_environment
    to_concatenated_name_hash('_').each_with_object({}) do |pair, env_hash|
      env_hash[pair[0].upcase] = pair[1].to_s
    end
  end
rubocop:disable Metrics/CyclomaticComplexity, Metrics/LineLength
 rubocop:enable Metrics/CyclomaticComplexity, Metrics/LineLength

 Internal: Converts a Settings object into a hash that is compatible as an
 environment variable hash.

 Example:

   settings = Settings.new settings: {
                             my_setting:     'my value',
                             my_sub_setting: {
                               my_sub_sub_setting_1: 'my sub value 1',
                               my_sub_sub_setting_2: 'my sub value 2',
                             }
   settings.to_environment
   # => {
     'MY_SETTING'                          => 'my value',
     'MY_SUB_SETTING_MY_SUB_SUB_SETTING_1' => 'my sub value 1',
     'MY_SUB_SETTING_MY_SUB_SUB_SETTING_2' => 'my sub value 2',
   }

 Returns a Hash sorted alphabetically by the names of the keys