Sha256: 19aa311c7df3caaa1da7bb8413cb75ebbb1e53280a7c15d14f630de0b36644f6

Contents?: true

Size: 1.5 KB

Versions: 40

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

module Cocina
  module Models
    class Collection < Struct
      include Checkable

      TYPES = ['http://cocina.sul.stanford.edu/models/collection.jsonld',
               'http://cocina.sul.stanford.edu/models/curated-collection.jsonld',
               'http://cocina.sul.stanford.edu/models/user-collection.jsonld',
               'http://cocina.sul.stanford.edu/models/exhibit.jsonld',
               'http://cocina.sul.stanford.edu/models/series.jsonld'].freeze

      # The content type of the Collection. Selected from an established set of values.
      # example: item
      attribute :type, Types::Strict::String.enum(*Collection::TYPES)
      # example: druid:bc123df4567
      attribute :externalIdentifier, Types::Strict::String
      # Primary processing label (can be same as title) for a Collection.
      attribute :label, Types::Strict::String
      # Version for the Collection within SDR.
      attribute :version, Types::Strict::Integer
      attribute(:access, Access.default { Access.new })
      attribute :administrative, Administrative.optional.meta(omittable: true)
      attribute :description, Description.optional.meta(omittable: true)
      attribute :identification, CollectionIdentification.optional.meta(omittable: true)

      def self.new(attributes = default_attributes, safe = false, validate = true, &block)
        Validator.validate(self, attributes.with_indifferent_access) if validate && name
        super(attributes, safe, &block)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
cocina-models-0.58.2 lib/cocina/models/collection.rb
cocina-models-0.58.1 lib/cocina/models/collection.rb
cocina-models-0.58.0 lib/cocina/models/collection.rb
cocina-models-0.57.0 lib/cocina/models/collection.rb
cocina-models-0.56.1 lib/cocina/models/collection.rb
cocina-models-0.56.0 lib/cocina/models/collection.rb
cocina-models-0.55.0 lib/cocina/models/collection.rb
cocina-models-0.54.0 lib/cocina/models/collection.rb
cocina-models-0.54.0.beta.2 lib/cocina/models/collection.rb
cocina-models-0.53.1 lib/cocina/models/collection.rb
cocina-models-0.54.0.beta.1 lib/cocina/models/collection.rb
cocina-models-0.53.0 lib/cocina/models/collection.rb
cocina-models-0.52.0 lib/cocina/models/collection.rb
cocina-models-0.51.0 lib/cocina/models/collection.rb
cocina-models-0.50.0 lib/cocina/models/collection.rb
cocina-models-0.49.0 lib/cocina/models/collection.rb
cocina-models-0.48.0 lib/cocina/models/collection.rb
cocina-models-0.47.2 lib/cocina/models/collection.rb
cocina-models-0.47.1 lib/cocina/models/collection.rb
cocina-models-0.47.0 lib/cocina/models/collection.rb