class ActivePubsub::Event

Public Class Methods

new(exchange, name, record) click to toggle source

attributes have to be set for purposes of marshaling

# File lib/active_pubsub/event.rb, line 17
def initialize(exchange, name, record)
  self[:exchange] = exchange
  self[:name] = name
  self[:record] = record
  self[:id] = ::SecureRandom.hex
  self[:record_type] = record.class.name
  self[:occured_at] ||= ::DateTime.now
  self[:routing_key] ||= [exchange, name].join('.')
end