-
Notifications
You must be signed in to change notification settings - Fork 0
/
descriptive_basic_value.rb
34 lines (33 loc) · 1.92 KB
/
descriptive_basic_value.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true
module Cocina
module Models
# Basic value model for descriptive elements. Can only have one of value, parallelValue, groupedValue, or structuredValue.
class DescriptiveBasicValue < Struct
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
# String or integer value of the descriptive element.
attribute? :value, Types::Nominal::Any
# Type of value provided by the descriptive element. See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.
attribute? :type, Types::Strict::String
# Status of the descriptive element value relative to other instances of the element.
attribute? :status, Types::Strict::String
# Code value of the descriptive element.
attribute? :code, Types::Strict::String
# URI value of the descriptive element.
attribute? :uri, Types::Strict::String
attribute? :standard, Standard.optional
attribute? :encoding, Standard.optional
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
attribute? :source, Source.optional
# The preferred display label to use for the descriptive element in access systems.
attribute? :displayLabel, Types::Strict::String
# A term providing information about the circumstances of the statement (e.g., approximate dates).
attribute? :qualifier, Types::Strict::String
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
attribute? :valueLanguage, DescriptiveValueLanguage.optional
# URL or other pointer to the location of the value of the descriptive element.
attribute? :valueAt, Types::Strict::String
end
end
end