Class: Ddr::Events::FixityCheckEvent

Inherits:
Event
  • Object
show all
Includes:
PreservationEventBehavior, ReindexObjectAfterSave
Defined in:
lib/ddr/events/fixity_check_event.rb

Constant Summary

Constants included from PreservationEventBehavior

PreservationEventBehavior::EVENT_ID_TYPE, PreservationEventBehavior::LINKING_OBJECT_ID_TYPE

Constants inherited from Event

Event::DATE_TIME_FORMAT, Event::DDR_SOFTWARE, Event::DEFAULT_SORT_ORDER, Event::FAILURE, Event::INVALID, Event::OUTCOMES, Event::SUCCESS, Event::SYSTEM, Event::VALID

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PreservationEventBehavior

#as_premis, #preservation_event_type, #to_xml

Methods inherited from Event

#comment_or_summary, #display_type, #event_date_time_s, #failure!, #failure?, for_object, for_pid, #object, #object=, #performed_by, #pid=, #success!, #success?, #user=

Class Method Details

.call(*args) ⇒ Object

Message sent by ActiveSupport::Notifications



12
13
14
15
16
17
18
# File 'lib/ddr/events/fixity_check_event.rb', line 12

def self.call(*args)
  super do |payload|
    results = payload.delete(:results)
    payload[:outcome] = results.success? ? SUCCESS : FAILURE
    payload[:detail] = "Fixity check results:\n\n#{results}"
  end
end

Instance Method Details

#to_solrObject



20
21
22
23
# File 'lib/ddr/events/fixity_check_event.rb', line 20

def to_solr
  { Ddr::Index::Fields::LAST_FIXITY_CHECK_ON => event_date_time_s,
    Ddr::Index::Fields::LAST_FIXITY_CHECK_OUTCOME => outcome }
end