cocina_display 1.8.2 → 1.9.0

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: eb0bba4d19bc1aa9c9e50e75595491b54fb0fe615947305cd46d7a31c176c12c
4
- data.tar.gz: 813afddbd4c11d0ac2fe76ec4f8167b27478b448924fae48dc5c59e4350c0035
3
+ metadata.gz: d724bfbe5e313a116cdba675f7d4f563662e8370f9ede927bef32a8cb7f90f26
4
+ data.tar.gz: e3fccfd8188a3f21ad05beb49d281bca8e24cf7e03524b51bd03fde4facbfa90
5
5
  SHA512:
6
- metadata.gz: 68fc4be5a58b31b54798ecfdde47395bd3984ac2950d80ed8b089beae7a800947a729daca42627411fe4d32218b6b96dbf3899bea6584c5de649454e147ed345
7
- data.tar.gz: 7bdc1bfe6c7050175cdd7b1ffa44640f636f2868238b2702bb9298b4ac0d6422867b8d1eb04a845f91d228770897cc3072b04abf112cdb8c592a6aefa3f555b5
6
+ metadata.gz: 1a3bcecb41e8a3ca656f079f2fb7f09aa256669e868c0ca34c1b42e5e60ed3e083b1f1bb862122f0a9864fbfd989406a961671b560edff1ba8d29e9620b0c62c
7
+ data.tar.gz: 5f1b3688911de060ff1a7ef6a31f4e98a300d217a42fb27cf76d401766a4d741a93821d26f0bdb7549506e462911d0a9da3f5fc25c68d041b7a7d2cc12285b29
@@ -57,7 +57,7 @@ module CocinaDisplay
57
57
  # The type of the identifier, e.g. "DOI".
58
58
  # @return [String, nil]
59
59
  def type
60
- ("DOI" if doi?) || cocina["type"].presence
60
+ ("DOI" if doi?) || ("ORCID" if orcid_uri?) || cocina["type"].presence
61
61
  end
62
62
 
63
63
  # The declared encoding of the identifier, if any.
@@ -97,5 +97,12 @@ module CocinaDisplay
97
97
  def label_key
98
98
  type&.parameterize&.underscore
99
99
  end
100
+
101
+ # Identifer is an ORCID if the URI contains "orcid.org".
102
+ # (in other cases this is indicated by type)
103
+ # @return [Boolean]
104
+ def orcid_uri?
105
+ cocina["uri"]&.include?("orcid.org")
106
+ end
100
107
  end
101
108
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "1.8.2" # :nodoc:
5
+ VERSION = "1.9.0" # :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.8.2
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Budak