Class: ActivePubsub::Event
- Inherits:
-
Object
- Object
- ActivePubsub::Event
- Includes:
- ActiveAttr::Model, ActiveModel::AttributeMethods
- Defined in:
- lib/active_pubsub/event.rb
Instance Method Summary collapse
-
#initialize(exchange, name, record) ⇒ Event
constructor
attributes have to be set for purposes of marshaling.
Constructor Details
#initialize(exchange, name, record) ⇒ Event
attributes have to be set for purposes of marshaling
17 18 19 20 21 22 23 24 25 |
# 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 |