Class: Html2rss::Config::Preparer

Inherits:
Object
  • Object
show all
Defined in:
lib/html2rss/config.rb

Overview

Normalizes raw config input before validation.

Instance Method Summary collapse

Instance Method Details

#call(config) ⇒ Hash{Symbol => Object}

Returns config with defaults and deprecations applied.

Parameters:

  • config (Hash{Symbol => Object})

    raw config input

Returns:

  • (Hash{Symbol => Object})

    config with defaults and deprecations applied



83
84
85
86
87
88
89
90
91
92
# File 'lib/html2rss/config.rb', line 83

def call(config)
  config = config.dup if config.frozen?

  config = handle_deprecated_channel_attributes(config)
  config = apply_default_config(config)
  config = apply_default_selectors_config(config) if config[:selectors]
  config = apply_default_auto_source_config(config) if config[:auto_source]

  config
end