Class: Hyrax::Listeners::ObjectLifecycleListener

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/listeners/object_lifecycle_listener.rb

Overview

Listens for events related to the PCDM Object lifecycles.

Instance Method Summary collapse

Instance Method Details

#on_object_deleted(event) ⇒ void

This method returns an undefined value.

Called when 'object.deleted' event is published

Parameters:

  • event (Dry::Events::Event)

12
13
14
# File 'app/services/hyrax/listeners/object_lifecycle_listener.rb', line 12

def on_object_deleted(event)
  ContentDeleteEventJob.perform_later(event[:id].to_s, event[:user])
end

#on_object_deposited(event) ⇒ void

This method returns an undefined value.

Called when 'object.deposited' event is published

Parameters:

  • event (Dry::Events::Event)

20
21
22
# File 'app/services/hyrax/listeners/object_lifecycle_listener.rb', line 20

def on_object_deposited(event)
  ContentDepositEventJob.perform_later(event[:object], event[:user])
end

#on_object_metadata_updated(event) ⇒ void

This method returns an undefined value.

Called when 'object.metadata.updated' event is published

Parameters:

  • event (Dry::Events::Event)

28
29
30
# File 'app/services/hyrax/listeners/object_lifecycle_listener.rb', line 28

def (event)
  ContentUpdateEventJob.perform_later(event[:object], event[:user])
end