Sha256: 7818c0da0e33ace1350badf939290f947b15eb5794b6cd3ca559664d5dca8b8f

Contents?: true

Size: 1.22 KB

Versions: 36

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module Cocina
  module Models
    class RequestCollection < 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

      # example: item
      attribute :type, Types::Strict::String.enum(*RequestCollection::TYPES)
      attribute :label, Types::Strict::String
      attribute :version, Types::Strict::Integer
      attribute(:access, Access.default { Access.new })
      attribute(:administrative, Administrative.default { Administrative.new })
      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

36 entries across 36 versions & 1 rubygems

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