Module: ConfigX::Configurable

Included in:
Config, UntypedConfig
Defined in:
lib/config_x/configurable.rb

Instance Method Summary collapse

Instance Method Details

#to_hHash

This method is abstract.

Returns:

  • (Hash)


# File 'lib/config_x/configurable.rb', line 7

#with_fallback(fallback) ⇒ Configurable

Merges the current configuration with a fallback configuration.

Parameters:

Returns:

  • (Configurable)

    a new Config object with the merged configuration



15
16
17
18
19
20
21
# File 'lib/config_x/configurable.rb', line 15

def with_fallback(fallback)
  DeepMerge.deep_merge!(
    to_h,
    fallback.to_h,
    overwrite_arrays: true
  ).then { self.class.new(_1) }
end