Sha256: 5413674f9ae213b9d24042e95126a9f6673ad4fbcfeb195bc34accf6a4f7e522

Contents?: true

Size: 886 Bytes

Versions: 1

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

module DispatchRider
  class Publisher
    module ConfigurationReader
      class << self
        def load_config(configuration, publisher)
          configure_notification_services(configuration.notification_services, publisher)
          configure_destinations(configuration.destinations, publisher)
        end

        private

        def configure_notification_services(notification_services, publisher)
          notification_services.each do |service|
            publisher.register_notification_service(service.name, **service.options)
          end
        end

        def configure_destinations(destinations, publisher)
          destinations.each do |destination|
            publisher.register_destination(destination.name, destination.service, destination.channel, destination.options)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dispatch-rider-2.2.0 lib/dispatch-rider/publisher/configuration_reader.rb