def merge(other)
    other_settings = if other.is_a? Settings
                       other
                     elsif other.is_a? Hash
                       Settings.new(settings: other)
                     end

    # rubocop:disable Metrics/LineLength
    Settings.new(
      encryption_keys: encryption_keys.any? ? encryption_keys : other_settings.encryption_keys,
      decryption_keys: decryption_keys.any? ? decryption_keys : other_settings.decryption_keys,
      namespaces:      (namespaces + other_settings.namespaces),
      settings:        raw_data.merge(other_settings.raw_data),
    )
    # rubocop:enable Metrics/LineLength
  end
def merge(other)
    other_settings = if other.is_a? Settings
                       other
                     elsif other.is_a? Hash
                       Settings.new(settings: other)
                     end

    # rubocop:disable Metrics/LineLength
    Settings.new(
      encryption_keys: encryption_keys.any? ? encryption_keys : other_settings.encryption_keys,
      decryption_keys: decryption_keys.any? ? decryption_keys : other_settings.decryption_keys,
      namespaces:      (namespaces + other_settings.namespaces),
      settings:        raw_data.merge(other_settings.raw_data),
    )
    # rubocop:enable Metrics/LineLength
  end
Internal: Merges a Settings object with another Settings object or
 a hash-like object.

 Also, if merging Settings, it will merge all other Settings data as well.

 Example:

   settings        = Settings.new settings: { my_setting:        'my value' }
   other_settings  = Settings.new settings: { my_other_setting:  'my other value' }

   settings.merge other_settings

   settings
   # => {
     'my_setting'        => 'my value',
     'my_other_setting'  => 'my other value',
   }

 Returns a new Settings object