Method: Html2rss::Config#initialize

Defined in:
lib/html2rss/config.rb

#initialize(feed_config, global = {}, params = {}) ⇒ Config

Initializes the Config object with feed configuration, global settings, and parameters.

Parameters:

  • feed_config (Hash<Symbol, Object>)

    The configuration hash containing ‘:channel` and `:selectors`.

  • global (Hash<Symbol, Object>) (defaults to: {})

    Global settings hash.

  • params (Hash<Symbol, String>) (defaults to: {})

    Parameters hash.

Raises:

[View source]

45
46
47
48
49
50
51
52
# File 'lib/html2rss/config.rb', line 45

def initialize(feed_config, global = {}, params = {})
  channel_config = feed_config[:channel]
  raise ChannelMissing, 'Channel configuration is missing in feed_config' unless channel_config

  @channel = Channel.new(channel_config, params:)
  @selectors = Selectors.new(feed_config[:selectors])
  @global = global
end