Sha256: 356d258e94c12c4131546ae74e86fbe1837264e3c0b77828b369d54214c9888e
Contents?: true
Size: 936 Bytes
Versions: 6
Compression:
Stored size: 936 Bytes
Contents
module Ddr module Actions class FixityCheck # Return result of fixity check - wrapped by a notifier def self.execute(object) ActiveSupport::Notifications.instrument(Ddr::Notifications::FIXITY_CHECK) do |payload| payload[:result] = _execute(object) end end # Return result of fixity check def self._execute(object) Result.new(pid: object.pid).tap do |r| object.datastreams_having_content.each do |dsid, ds| r.success &&= ds.dsChecksumValid r.results[dsid] = ds.profile end end end class Result attr_accessor :pid, :success, :results, :checked_at def initialize(args={}) @pid = args[:pid] @success = args[:success] || true @results = args[:results] || {} @checked_at = args[:checked_at] || Time.now.utc end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems