Sha256: c82fbf90e46217f2e46118d96bedc95e2ffad04a4d97c5b98941e6c5869e75a4
Contents?: true
Size: 1.17 KB
Versions: 2
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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dispatch-rider-2.1.0 | lib/dispatch-rider/publisher/configuration.rb |
dispatch-rider-2.0.0 | lib/dispatch-rider/publisher/configuration.rb |