lib/dispatch-rider/publisher/base.rb in dispatch-rider-1.3.6 vs lib/dispatch-rider/publisher/base.rb in dispatch-rider-1.4.0
- old
+ new
@@ -19,31 +19,18 @@
def publish(*args, &block)
raise NotImplementedError
end
- private
-
- def generate_new_message_id
- if DispatchRider.config.debug
- DispatchRider::Debug::PUBLISHER_MESSAGE_GUID
- else
- SecureRandom.uuid
- end
- end
-
end
def initialize(publisher = nil)
@publisher = publisher
end
def publish(body)
raise ArgumentError, 'body should be a hash' unless body.kind_of?(Hash)
- body = body.merge({
- 'guid' => generate_new_message_id,
- })
publisher.publish(destinations: destinations, message: { subject: subject, body: body })
end
def publisher
@publisher || self.class.default_publisher
@@ -53,15 +40,9 @@
self.class.instance_variable_get(:@destinations)
end
def subject
self.class.instance_variable_get(:@subject)
- end
-
- private
-
- def generate_new_message_id
- self.class.send(:generate_new_message_id)
end
end
end