lib/dispatch-rider/publisher.rb in dispatch-rider-0.0.3 vs lib/dispatch-rider/publisher.rb in dispatch-rider-0.0.4
- old
+ new
@@ -1,10 +1,16 @@
+require "active_support/core_ext/hash/indifferent_access"
+
# This class takes care of the publishing side of the messaging system.
module DispatchRider
class Publisher
attr_reader :service_channel_mapper, :notification_service_registrar, :publishing_destination_registrar, :sns_channel_registrar
+ def configure(configuration_hash = {})
+ ConfigurationReader.parse(configuration_hash.with_indifferent_access, self)
+ end
+
def initialize
@notification_service_registrar = DispatchRider::Registrars::NotificationService.new
@publishing_destination_registrar = DispatchRider::Registrars::PublishingDestination.new
@service_channel_mapper = ServiceChannelMapper.new(publishing_destination_registrar)
end
@@ -61,5 +67,7 @@
end
end
end
end
end
+
+require_relative "publisher/configuration_reader"