Module: Ddr::Datastreams

Extended by:
ActiveSupport::Autoload, Deprecation
Defined in:
lib/ddr/datastreams.rb

Constant Summary collapse

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 ]

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ddr/datastreams.rb', line 14

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