Sha256: d4222d5aefed8d139dfbc1274d7ce4017edecc4c778bf26cca623533586994f8

Contents?: true

Size: 1.66 KB

Versions: 25

Compression:

Stored size: 1.66 KB

Contents

module Ddr
  module Datastreams
    extend ActiveSupport::Autoload
    extend Deprecation

    CHECKSUM_TYPE_MD5    = "MD5"
    CHECKSUM_TYPE_SHA1   = "SHA-1"
    CHECKSUM_TYPE_SHA256 = "SHA-256"
    CHECKSUM_TYPE_SHA384 = "SHA-384"
    CHECKSUM_TYPE_SHA512 = "SHA-512"

    CHECKSUM_TYPES = [ CHECKSUM_TYPE_MD5, CHECKSUM_TYPE_SHA1, CHECKSUM_TYPE_SHA256, CHECKSUM_TYPE_SHA384, CHECKSUM_TYPE_SHA512 ]

    def self.const_missing(name)
      case name
      when :CONTENT, :EXTRACTED_TEXT, :FITS, :STRUCT_METADATA, :THUMBNAIL
        Deprecation.warn(self, "Ddr::Datastreams::#{name} is deprecated." \
                               " Use Ddr::Models::File::#{name} instead.")
        Ddr::Models::File.const_get(name)
      when :DESC_METADATA
        Deprecation.warn(self, "Ddr::Datastreams::DESC_METADATA is deprecated." \
                               " Use Ddr::Models::Metadata::DESC_METADATA instead.")
        Ddr::Models::Metadata::DESC_METADATA
      when :FitsDatastream
        Deprecation.warn(self, "Ddr::Datastreams::FitsDatastream is deprecated." \
                               " Use Ddr::Models::FitsXmlFile instead.")
        Ddr::Models::FitsXmlFile
      when :StructuralMetadataDatastream
        Deprecation.warn(self, "Ddr::Datastreams::StructuralMetadataDatastream is deprecated." \
                               " Use Ddr::Models::StructuralMetadataFile instead.")
        Ddr::Models::StructuralMetadataFile
      when :PlainTextDatastream
        Deprecation.warn(self, "Ddr::Datastreams::PlainTextDatastream is deprecated." \
                               " Use Ddr::Models::File instead.")
        Ddr::Models::File
      else
        super
      end
    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ddr-models-3.0.8 lib/ddr/datastreams.rb
ddr-models-3.0.7 lib/ddr/datastreams.rb
ddr-models-3.0.6 lib/ddr/datastreams.rb
ddr-models-3.0.5 lib/ddr/datastreams.rb
ddr-models-3.0.4 lib/ddr/datastreams.rb
ddr-models-3.0.3 lib/ddr/datastreams.rb
ddr-models-3.0.2 lib/ddr/datastreams.rb
ddr-models-3.0.1 lib/ddr/datastreams.rb
ddr-models-3.0.0 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc6 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc5 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc4 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc3 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc2 lib/ddr/datastreams.rb
ddr-models-3.0.0.rc1 lib/ddr/datastreams.rb
ddr-models-3.0.0.beta.22 lib/ddr/datastreams.rb
ddr-models-3.0.0.beta.21 lib/ddr/datastreams.rb
ddr-models-3.0.0.beta.20 lib/ddr/datastreams.rb
ddr-models-3.0.0.beta.18 lib/ddr/datastreams.rb
ddr-models-3.0.0.beta.17 lib/ddr/datastreams.rb