Sha256: 8dd744b68a11b9003ca05b39c308e23bf650c2fae713255afe34a6a7f787a666

Contents?: true

Size: 1.36 KB

Versions: 2

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

module Cocina
  module Models
    # Metadata for a file.
    # See http://sul-dlss.github.io/cocina-models/maps/File.json
    class File < Struct
      include Checkable

      TYPES = [
        Vocab.file
      ].freeze

      # Represents access controls on the file
      class Access < Struct
        attribute :access, Types::String.default('dark')
                                        .enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
      end

      # Represents the administration of the file
      class Administrative < Struct
        attribute :sdrPreserve, Types::Strict::Bool.optional.default(false)
        attribute :shelve, Types::Strict::Bool.optional.default(false)
      end

      # Represents a digest (checksum) value for a file
      class Fixity < Struct
        attribute :type, Types::String.enum('md5', 'sha1')
        attribute :digest, Types::Strict::String
      end

      class Identification < Struct
      end

      # Represents some technical aspect of the file
      class Presentation < Struct
        attribute :height, Types::Strict::Integer.optional.default(nil)
        attribute :width, Types::Strict::Integer.optional.default(nil)
      end

      class Structural < Struct
      end

      include FileAttributes
      attribute :externalIdentifier, Types::Strict::String
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocina-models-0.28.0 lib/cocina/models/file.rb
cocina-models-0.27.0 lib/cocina/models/file.rb