cocina-models 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/maps/DRO.json +1 -1
- data/docs/maps/Fileset.json +1 -1
- data/lib/cocina/models/dro.rb +2 -2
- data/lib/cocina/models/file_set.rb +2 -2
- data/lib/cocina/models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77698fc3e680b8237e120b83f3e2ad4764a64e2d5c3de90473ec8f19d07e1b4d
|
4
|
+
data.tar.gz: 931d0411a532ebdc9cc55324fd7dacc052b4456689b6e690cdb0f1a8d6cc4a3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ea3d5073f444b59cd2dd09f2440d9d72e632325cb56b58e47093df8b62e2814714fad3f1fea97d89088173a091058a8011e6ebf52bbbb62571d3b42b266b9ce
|
7
|
+
data.tar.gz: ed3467cb513ca1591990ed9222b1a4793cbc7281d34af7d3aa99853241b02b8e0b58b884b50d114cd040bcabfdd4a5b96f67ea7dd3763514de0acb6b3099874b
|
data/docs/maps/DRO.json
CHANGED
data/docs/maps/Fileset.json
CHANGED
data/lib/cocina/models/dro.rb
CHANGED
@@ -75,11 +75,11 @@ module Cocina
|
|
75
75
|
|
76
76
|
# Structural sub-schema for the DRO
|
77
77
|
class Structural < Dry::Struct
|
78
|
-
attribute :contains, Types::Strict::Array.of(
|
78
|
+
attribute :contains, Types::Strict::Array.of(FileSet).meta(omittable: true)
|
79
79
|
|
80
80
|
def self.from_dynamic(dyn)
|
81
81
|
params = {}
|
82
|
-
params[:contains] = dyn['contains'] if dyn['contains']
|
82
|
+
params[:contains] = dyn['contains'].map { |fs| FileSet.from_dynamic(fs) } if dyn['contains']
|
83
83
|
Structural.new(params)
|
84
84
|
end
|
85
85
|
end
|
@@ -17,11 +17,11 @@ module Cocina
|
|
17
17
|
|
18
18
|
# Structural sub-schema for the FileSet
|
19
19
|
class Structural < Dry::Struct
|
20
|
-
attribute :contains, Types::Strict::Array.of(
|
20
|
+
attribute :contains, Types::Strict::Array.of(Cocina::Models::File).meta(omittable: true)
|
21
21
|
|
22
22
|
def self.from_dynamic(dyn)
|
23
23
|
params = {}
|
24
|
-
params[:contains] = dyn['contains'] if dyn['contains']
|
24
|
+
params[:contains] = dyn['contains'].map { |f| Cocina::Models::File.from_dynamic(f) } if dyn['contains']
|
25
25
|
Structural.new(params)
|
26
26
|
end
|
27
27
|
end
|
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.
|
4
|
+
version: 0.12.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-01-
|
11
|
+
date: 2020-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|