module Atr::Publishable

Constants

PUBLISHABLE_ACTIONS

Attributes

publication_scopes[RW]

Private Instance Methods

publish_created_event() click to toggle source
# File lib/atr/publishable.rb, line 36
def publish_created_event
  routing_key = self.class.build_routing_key_for_record_action(self, "created")
  event_name = self.class.resource_action_routing_key("created")
  record_created_event = ::Atr::Event.new(routing_key, event_name, self)

  ::Atr.publish_event(record_created_event)
end
publish_destroyed_event() click to toggle source
# File lib/atr/publishable.rb, line 44
def publish_destroyed_event
  routing_key = self.class.build_routing_key_for_record_action(self, "destroyed")
  event_name = self.class.resource_action_routing_key("destroyed")
  record_destroyed_event = ::Atr::Event.new(routing_key, event_name, self)

  ::Atr.publish_event(record_destroyed_event)
end
publish_updated_event() click to toggle source
# File lib/atr/publishable.rb, line 28
def publish_updated_event
  routing_key = self.class.build_routing_key_for_record_action(self, "updated")
  event_name = self.class.resource_action_routing_key("updated")
  record_updated_event = ::Atr::Event.new(routing_key, event_name, self)

  ::Atr.publish_event(record_updated_event)
end