Sha256: 6ef4979d35cda865bdaca92a6afd4632a32ae0e6e71e6f57593d4fcdf073d141
Contents?: true
Size: 1.17 KB
Versions: 55
Compression:
Stored size: 1.17 KB
Contents
module DispatchRider class Publisher::Configuration def initialize(configuration_hash = {}) @notification_services = [] @destinations = [] parse(configuration_hash) end def notification_services @notification_services end def destinations @destinations end def parse(configuration_hash) clear configuration_hash = configuration_hash.with_indifferent_access configure_notification_services(configuration_hash[:notification_services] || {}) configure_destinations(configuration_hash[:destinations] || {}) end def clear @notification_services.clear @destinations.clear end private def configure_notification_services(notification_services_hash) notification_services_hash.each do |name, options| @notification_services << NotificationService.new(name, options) end end def configure_destinations(destinations_hash) destinations_hash.each do |name, options| @destinations << Destination.new(name, options) end end end end require_relative "configuration/destination" require_relative "configuration/notification_service"
Version data entries
55 entries across 55 versions & 1 rubygems