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: ba47d60cffc6985c853c485c72ab3a5bb42bdd7a4768a29feebc580176102047
4
- data.tar.gz: 5c712b7691db2b6b26cf9f64a799948f3fe3c4a65b72f9b71580a2da524a5077
3
+ metadata.gz: d8a84bc81bc105293d760eda67315d31a9cc253e73e7a92953d1bfd6a4705eea
4
+ data.tar.gz: 73acf3b8a4553b3651322fb9b3c3d005386bccc571cf0e52a4b6b726ad110248
5
5
  SHA512:
6
- metadata.gz: ad6119d07af80cc547058ac821cd16a8b3023b2772cb6687d22dd73abf46a64f465c4a9004bdaa8a07521388f1817c16c00bd0cafe48488b27b6a01eef22451c
7
- data.tar.gz: 782c53f720e2102b5b7c8c0349a22562356e037dfcc2917106bbea1174e3baa68661f778dc3df17efb6597836b3d3ab5bafd435be901766f92602044f09aac2b
6
+ metadata.gz: 0440fd1e3ce299e2c3d705ea7285b7048c2cb6dccf63158987476f9ece9f79ffb7739f80b4bde364a697b121af4d1c94c14d6ffdb06f7fffd1a8901afea835b4
7
+ data.tar.gz: 8472cf7f3bd82637a2979cd5995157c22ef832ff388e905c4e24bb94d000e3c99f3e151f63dbab7c75fc2d5aa22970a51d8a754ba75c4b3c136db063084ca6f5
@@ -76,7 +76,7 @@ module CocinaDisplay
76
76
  # @return [String, nil]
77
77
  # @example "author, editor, publisher"
78
78
  def display_role
79
- roles.map(&:to_s).join(", ") if role?
79
+ roles.join(", ") if role?
80
80
  end
81
81
 
82
82
  # The primary display name for the contributor as a string.
@@ -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.
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "2.9.0" # :nodoc:
5
+ VERSION = "2.9.1" # :nodoc:
6
6
  end
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.0
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-14 00:00:00.000000000 Z
10
+ date: 2026-07-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: janeway-jsonpath