Sha256: 522069c58c4480f251441f13d378314c0a06582e318ebb9317ff52fccdd824b9
Contents?: true
Size: 640 Bytes
Versions: 7
Compression:
Stored size: 640 Bytes
Contents
require 'json' module EventBus # Public: An class which decorates el-rabbit topic creation. # class Emitter # Public: Produces a event on the Broker. # # event - The event to be produced. # # Returns the Event. def self.trigger(*events) events.flatten.each_with_index do |event, index| raise MissingAttributeError.new("Event on position #{index} must have a body") unless event.has_body? raise MissingAttributeError.new("Event on position #{index} must have a name") unless event.has_name? end EventBus::Config.broker.produce(events.flatten) events end end end
Version data entries
7 entries across 7 versions & 1 rubygems