cocina_display 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8a84bc81bc105293d760eda67315d31a9cc253e73e7a92953d1bfd6a4705eea
|
|
4
|
+
data.tar.gz: 73acf3b8a4553b3651322fb9b3c3d005386bccc571cf0e52a4b6b726ad110248
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0440fd1e3ce299e2c3d705ea7285b7048c2cb6dccf63158987476f9ece9f79ffb7739f80b4bde364a697b121af4d1c94c14d6ffdb06f7fffd1a8901afea835b4
|
|
7
|
+
data.tar.gz: 8472cf7f3bd82637a2979cd5995157c22ef832ff388e905c4e24bb94d000e3c99f3e151f63dbab7c75fc2d5aa22970a51d8a754ba75c4b3c136db063084ca6f5
|
|
@@ -11,7 +11,7 @@ module CocinaDisplay
|
|
|
11
11
|
# For self-deposit resource types, the flat value comprises primary and any subtypes.
|
|
12
12
|
# @return [String]
|
|
13
13
|
def flat_value
|
|
14
|
-
return super unless stanford_self_deposit?
|
|
14
|
+
return super unless stanford_self_deposit? && structured?
|
|
15
15
|
return primary_type unless subtypes.any?
|
|
16
16
|
|
|
17
17
|
"#{primary_type} (#{subtypes.join(", ")})"
|
|
@@ -32,6 +32,12 @@ module CocinaDisplay
|
|
|
32
32
|
|
|
33
33
|
private
|
|
34
34
|
|
|
35
|
+
# Is this a structured resource type?
|
|
36
|
+
# @return [Boolean]
|
|
37
|
+
def structured?
|
|
38
|
+
cocina.key?("structuredValue")
|
|
39
|
+
end
|
|
40
|
+
|
|
35
41
|
# @return [String]
|
|
36
42
|
def source
|
|
37
43
|
cocina.dig("source", "value")
|
|
@@ -46,7 +52,7 @@ module CocinaDisplay
|
|
|
46
52
|
# The primary type, if this is a structured self-deposit resource type.
|
|
47
53
|
# @return [String, nil]
|
|
48
54
|
def primary_type
|
|
49
|
-
type_components["type"].first
|
|
55
|
+
type_components["type"].first if structured?
|
|
50
56
|
end
|
|
51
57
|
|
|
52
58
|
# The subtypes, if this is a structured self-deposit resource type.
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocina_display
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.9.
|
|
4
|
+
version: 2.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Budak
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-28 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: janeway-jsonpath
|