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



71
72
73
74
75
76
77
78
79
80
# File 'lib/html2rss/config.rb', line 71

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