Sha256: 56de19f8851c11cc87f3aa07664ca5bcb4c52155e6fbfd39a0e0557d7cd586d2

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

module Cocina
  module Models
    # A digital repository collection.
    # See http://sul-dlss.github.io/cocina-models/maps/Collection.json
    class Collection < Struct
      include Checkable

      TYPES = [
        Vocab.collection,
        Vocab.curated_collection,
        Vocab.exhibit,
        Vocab.series,
        Vocab.user_collection
      ].freeze

      # Subschema for access concerns
      class Access < Struct
        attribute :access, Types::String.default('dark')
                                        .enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
      end

      # Subschema for administrative concerns
      class Administrative < Struct
        attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).default([].freeze)
        # TODO: Allowing hasAdminPolicy to be omittable for now (until rolled out to consumers),
        # but I think it's actually required for every Collection
        attribute :hasAdminPolicy, Types::Strict::String.optional.default(nil)
      end

      # Identification sub-schema for the Collection
      class Identification < Struct
        attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
      end

      class Structural < Struct
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cocina-models-0.29.0 lib/cocina/models/collection.rb
cocina-models-0.28.0 lib/cocina/models/collection.rb
cocina-models-0.27.0 lib/cocina/models/collection.rb