cocina_display 1.2.1 → 1.2.2

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: 949b52c4802fd53d9598d8a8999277d703d55ad371d4f8b4a5843e0831abe8d9
4
- data.tar.gz: 399e0c067ec059b5cdb0cdeda0c745a05905d53ce155ce172b7e6dd93ff7e0a4
3
+ metadata.gz: 13fa31ddb1ced6dce4cff9ba6c23273a717c517853724b0338834c8bc0584053
4
+ data.tar.gz: 393ea9fd0d3b923526eb2ef9165d1341bd0a59d4053e5cd0d3994cdc4b2e0ad2
5
5
  SHA512:
6
- metadata.gz: 657874144a2e8a0d2c2acf7fc6128592e6b69a6487a9ab4c4a45a24e9fa838c832b83e99f3b836932e46474054f33e993299527419f979a6d2d89c269d31a146
7
- data.tar.gz: ff4a6988d579c7d6fb115e4416a7b26a48f981374ad525f89aeed39c2f335b2e7a0ea54a85e95d8dcfca3967580d8ff3f28c99d8fb270dd6927f3b7e4e2de2b8
6
+ metadata.gz: 269e719358ed43c1b76ff2f9a7dc63b2fca62f5fd3b1e9fd2a08b9fd978f3d052347a06424c5b06b54e64b39b32330cb77a6ee0ba840cae8b4b0f3ffeb578c10
7
+ data.tar.gz: 8227461a14e0a326652b49d32582ab7847b1946a7851e3b2b6f8123b5a5a21efbce2d4d86ff754c9ab65ac6bae315cdeb0fe4a9bbd159dd64199c0d522a061fd
@@ -38,14 +38,14 @@ module CocinaDisplay
38
38
  # String representation of the related resource.
39
39
  # @return [String, nil]
40
40
  def to_s
41
- main_title || url
41
+ display_data.flat_map(&:values).first
42
42
  end
43
43
 
44
44
  # URL to the related resource for link construction.
45
45
  # If there are multiple URLs, uses the first.
46
46
  # @return [String, nil]
47
47
  def url
48
- urls.first&.to_s || purl_url
48
+ (urls.map(&:to_s) + identifiers.map(&:uri) + [purl_url]).compact.first
49
49
  end
50
50
 
51
51
  # Is this a related resource with a URL?
@@ -59,7 +59,7 @@ module CocinaDisplay
59
59
  # @note Used for extended display of citations, e.g. on hp566jq8781.
60
60
  # @return [Array<DisplayData>]
61
61
  def display_data
62
- title_display_data + contributor_display_data + general_note_display_data + preferred_citation_display_data + access_display_data
62
+ title_display_data + contributor_display_data + general_note_display_data + preferred_citation_display_data + access_display_data + identifier_display_data
63
63
  end
64
64
 
65
65
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "1.2.1" # :nodoc:
5
+ VERSION = "1.2.2" # :nodoc:
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Budak