Class: Hyrax::Listeners::FileSetLifecycleListener

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

Overview

Listens for events related to Hydra Works FileSets

Instance Method Summary collapse

Instance Method Details

#on_file_set_attached(event) ⇒ void

This method returns an undefined value.

Called when ‘file.set.attached’ event is published

Parameters:

  • event (Dry::Events::Event)


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

def on_file_set_attached(event)
  FileSetAttachedEventJob.perform_later(event[:file_set], event[:user])
end

#on_file_set_restored(event) ⇒ void

This method returns an undefined value.

Called when ‘file.set.restored’ event is published

Parameters:

  • event (Dry::Events::Event)


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

def on_file_set_restored(event)
  ContentRestoredVersionEventJob
    .perform_later(event[:file_set], event[:user], event[:revision])
end