Class: Html2rss::Config::MultipleFeedsConfig

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

Overview

Handles multiple feeds within a single configuration hash. Individual feed configurations should be placed under the :feeds key, where each feed name is the key for its feed configuration. All global configuration keys (outside :feeds) are merged into each feed’s settings.

Constant Summary collapse

CONFIG_KEY_FEEDS =

Reserved YAML key under which multiple named feed configs are defined.

:feeds

Class Method Summary collapse

Class Method Details

.to_single_feed(config, yaml, multiple_feeds_key: CONFIG_KEY_FEEDS) ⇒ Hash

Merges global configuration into each feed’s configuration.

Parameters:

  • config (Hash)

    The feed-specific configuration.

  • yaml (Hash)

    The full YAML configuration.

  • multiple_feeds_key (Symbol) (defaults to: CONFIG_KEY_FEEDS)

    The key under which multiple feeds are defined.

Returns:

  • (Hash)

    The merged configuration.



20
21
22
23
24
25
26
# File 'lib/html2rss/config/multiple_feeds_config.rb', line 20

def to_single_feed(config, yaml, multiple_feeds_key: CONFIG_KEY_FEEDS)
  global_keys = yaml.keys - [multiple_feeds_key]
  global_keys.each do |key|
    config[key] = merge_key(config, yaml, key)
  end
  config
end