Sha256: 04af6923776cdbde4fa7dba61bc0a92bda88be8a87bb5a66fc883364ab6bacd6

Contents?: true

Size: 688 Bytes

Versions: 55

Compression:

Stored size: 688 Bytes

Contents

module Ddr
  module Models
    module FixityCheckable

      def datastreams_to_validate
        datastreams.select { |dsid, ds| ds.has_content? }
      end

      def fixity_checks
        Ddr::Events::FixityCheckEvent.for_object(self)
      end

      # Returns a Ddr::Actions::FixityCheck::Result for the object
      def fixity_check
        Ddr::Actions::FixityCheck.execute(self)
      end

      def last_fixity_check
        fixity_checks.last
      end

      def last_fixity_check_on
        last_fixity_check && last_fixity_check.event_date_time
      end

      def last_fixity_check_outcome
        last_fixity_check && last_fixity_check.outcome
      end

    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
ddr-models-2.4.7 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.6 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.5 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.10 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.9 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.8 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.7 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.4 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.6 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.3 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.2 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.4 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.1 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.0 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.0.rc6 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.3 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.0.rc5 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.0.rc4 lib/ddr/models/fixity_checkable.rb
ddr-models-3.0.0.beta.2 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.0.rc3 lib/ddr/models/fixity_checkable.rb