Class: Ddr::Actions::FixityCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/ddr/actions/fixity_check.rb

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

._execute(object) ⇒ Object

Return result of fixity check



13
14
15
16
17
18
19
20
# File 'lib/ddr/actions/fixity_check.rb', line 13

def self._execute(object)
  Result.new(pid: object.pid).tap do |r|
    object.datastreams_to_validate.each do |dsid, ds|
      r.success &&= ds.dsChecksumValid
      r.results[dsid] = ds.profile
    end
  end
end

.execute(object) ⇒ Object

Return result of fixity check - wrapped by a notifier



6
7
8
9
10
# File 'lib/ddr/actions/fixity_check.rb', line 6

def self.execute(object)
  ActiveSupport::Notifications.instrument(Ddr::Notifications::FIXITY_CHECK) do |payload|
    payload[:result] = _execute(object)
  end
end