Sha256: 19ad19b5353393297d125c2cdd5f123ad35a3d79af29ac9b2ccccc65449fbd0e

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

module Cocina
  module Models
    class Description < Struct
      attribute :title, Types::Strict::Array.of(DescriptiveValueRequired).default([].freeze)
      attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
      attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
      attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
      attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
      attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
      attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
      attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
      # Stanford persistent URL associated with the resource.
      attribute :purl, Types::Strict::String.meta(omittable: true)
      attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
      attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
      attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
      attribute :adminMetadata, DescriptiveAdminMetadata.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

7 entries across 7 versions & 1 rubygems

Version Path
cocina-models-0.40.1 lib/cocina/models/description.rb
cocina-models-0.40.0 lib/cocina/models/description.rb
cocina-models-0.39.0 lib/cocina/models/description.rb
cocina-models-0.38.0 lib/cocina/models/description.rb
cocina-models-0.37.0 lib/cocina/models/description.rb
cocina-models-0.36.0 lib/cocina/models/description.rb
cocina-models-0.35.0 lib/cocina/models/description.rb