cocina-models 0.39.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b596e537652f3adbdf99641f88e6cdd90a06a8fd60e4554c41124dcec66984e9
4
- data.tar.gz: fe1a342bdd92e4400ace4e1ee9f1fa0a2145186870c5adfc32ac5fb5a77bf366
3
+ metadata.gz: d9154e8ca9a9e0a023094e98709e443b58570a358deb4c8b329509642bfda0f7
4
+ data.tar.gz: 317c6faa7072fa4441c601e277a63b60149c183ba9b836ab95c0f2ee0f96f949
5
5
  SHA512:
6
- metadata.gz: f9b8910c593bcf0295cd290b2c843a93b143c9f6359d1b8d72aa9f62789731ae885bc1a24747228fd9f78adc84c75249b3732114da0b94a9fa74cb77e646acec
7
- data.tar.gz: c386a293ffd53005c3afb81248b6ab7c273b3f94b36fd3f93f9db45c35c8c720fd9c478bbefb9ad8f56bf7a9391c7eb7e2092610bd2c63c1615c4bdca45ad215
6
+ metadata.gz: 949161b1712417293974e89d98b62116d0cba3582d60fbfb728dfb6a51b78ca737ad02509a9f711cdc3aba27886caed1ca224711ec6ba80d3ba14822febfdf64
7
+ data.tar.gz: 5a3b10e3b9747b3e1317754eb40b0e3c9c581cf8397aaafdd8e5a5a338b07791f32b2f54d159e2399dd7934d1a49f709dd63af04388ad1d0e85386229d3be978
@@ -1,18 +1,25 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-03-06 16:50:50 -0800 using RuboCop version 0.74.0.
3
+ # on 2020-09-08 19:05:09 UTC using RuboCop version 0.89.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
10
- Metrics/AbcSize:
11
- Max: 37
9
+ # Offense count: 1
10
+ # Configuration parameters: AllowedMethods.
11
+ # AllowedMethods: present?, blank?, presence, try, try!
12
+ Lint/SafeNavigationChain:
13
+ Exclude:
14
+ - 'lib/cocina/generator/schema_base.rb'
15
+
16
+ # Offense count: 1
17
+ # Configuration parameters: IgnoredMethods.
18
+ Metrics/CyclomaticComplexity:
19
+ Max: 8
12
20
 
13
- # Offense count: 3
14
- # Configuration parameters: Max.
15
- RSpec/ExampleLength:
21
+ # Offense count: 1
22
+ # Configuration parameters: MinBodyLength.
23
+ Style/GuardClause:
16
24
  Exclude:
17
- - 'spec/cocina/models/dro_shared_examples.rb'
18
- - 'spec/cocina/models/file_set_shared_examples.rb'
25
+ - 'lib/cocina/generator/schema_base.rb'
@@ -54,7 +54,11 @@ module Cocina
54
54
  when 'boolean'
55
55
  'Strict::Bool'
56
56
  else
57
- raise "#{schema_doc.type} not supported"
57
+ if doc.one_of&.map(&:type).all? { |o| %w[integer string].include?(o) }
58
+ 'Nominal::Any'
59
+ else
60
+ raise "#{schema_doc.type} not supported"
61
+ end
58
62
  end
59
63
  end
60
64
 
@@ -5,8 +5,8 @@ module Cocina
5
5
  class DescriptiveBasicValue < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
- # String value of the descriptive element.
9
- attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # String or integer value of the descriptive element.
9
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
10
10
  # Type of value provided by the descriptive element.
11
11
  attribute :type, Types::Strict::String.meta(omittable: true)
12
12
  # Status of the descriptive element value relative to other instances of the element.
@@ -23,6 +23,7 @@ module Cocina
23
23
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
24
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
25
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ attribute :language, Standard.optional.meta(omittable: true)
26
27
  end
27
28
  end
28
29
  end
@@ -5,8 +5,8 @@ module Cocina
5
5
  class DescriptiveValue < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
- # String value of the descriptive element.
9
- attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # String or integer value of the descriptive element.
9
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
10
10
  # Type of value provided by the descriptive element.
11
11
  attribute :type, Types::Strict::String.meta(omittable: true)
12
12
  # Status of the descriptive element value relative to other instances of the element.
@@ -23,6 +23,7 @@ module Cocina
23
23
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
24
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
25
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ attribute :language, Standard.optional.meta(omittable: true)
26
27
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
27
28
  end
28
29
  end
@@ -5,8 +5,8 @@ module Cocina
5
5
  class DescriptiveValueRequired < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
- # String value of the descriptive element.
9
- attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # String or integer value of the descriptive element.
9
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
10
10
  # Type of value provided by the descriptive element.
11
11
  attribute :type, Types::Strict::String.meta(omittable: true)
12
12
  # Status of the descriptive element value relative to other instances of the element.
@@ -23,6 +23,7 @@ module Cocina
23
23
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
24
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
25
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ attribute :language, Standard.optional.meta(omittable: true)
26
27
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
27
28
  end
28
29
  end
@@ -5,8 +5,8 @@ module Cocina
5
5
  class Language < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
- # String value of the descriptive element.
9
- attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # String or integer value of the descriptive element.
9
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
10
10
  # Type of value provided by the descriptive element.
11
11
  attribute :type, Types::Strict::String.meta(omittable: true)
12
12
  # Status of the descriptive element value relative to other instances of the element.
@@ -23,6 +23,7 @@ module Cocina
23
23
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
24
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
25
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ attribute :language, Standard.optional.meta(omittable: true)
26
27
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
27
28
  attribute :script, DescriptiveValue.optional.meta(omittable: true)
28
29
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.39.0'
5
+ VERSION = '0.40.0'
6
6
  end
7
7
  end
@@ -467,6 +467,9 @@ components:
467
467
  type: array
468
468
  items:
469
469
  $ref: "#/components/schemas/DescriptiveValue"
470
+ language:
471
+ # description: Language of the descriptive element value.
472
+ $ref: "#/components/schemas/Standard"
470
473
  DescriptiveParallelValue:
471
474
  description: Value model for multiple representations of the same information (e.g. in different languages).
472
475
  type: object
@@ -851,7 +854,7 @@ components:
851
854
  $ref: '#/components/schemas/CatalogLink'
852
855
  Language:
853
856
  description: Languages, scripts, symbolic systems, and notations used in all
854
- or part of a resource.
857
+ or part of a resource or its descriptive metadata.
855
858
  type: object
856
859
  additionalProperties: false
857
860
  allOf:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.39.0
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport