Sha256: 28a8ba1805c5d29eaa9aac277ac834445dddaf6823131e9c474005aad93ff472

Contents?: true

Size: 1004 Bytes

Versions: 3

Compression:

Stored size: 1004 Bytes

Contents

# frozen_string_literal: true

module Cocina
  module Models
    # attributes common to both DRO and RequestDRO
    # See http://sul-dlss.github.io/cocina-models/maps/DRO.json
    module DroAttributes
      def self.included(obj)
        obj.attribute(:access, DRO::Access.default { DRO::Access.new })
        obj.attribute(:administrative, DRO::Administrative.default { DRO::Administrative.new })
        # TODO: Allowing description to be omittable for now (until rolled out to consumers),
        # but I think it's actually required for every DRO
        obj.attribute :description, Description.optional.meta(omittable: true)
        obj.attribute :geographic, DRO::Geographic.optional.meta(omittable: true)
        obj.attribute(:identification, DRO::Identification.default { DRO::Identification.new })
        obj.attribute :label, Types::Strict::String
        obj.attribute :type, Types::String.enum(*DRO::TYPES)
        obj.attribute :version, Types::Strict::Integer
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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