• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / pdc_describe / 7031ff5b-e2d7-4285-af8b-e7b55adfc48a

pending completion
7031ff5b-e2d7-4285-af8b-e7b55adfc48a

Pull #899

circleci

mccalluc
Finish removal of explicit if-then in js
Pull Request #899: Move messages up to sidebar on the right which can be toggled

1623 of 1788 relevant lines covered (90.77%)

105.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/app/models/pdc_metadata/name_identifier.rb
1
# frozen_string_literal: true
2
# Class for storing a named identifier for the creator in our local representation.  This identifier can be a person or organization.
3
# **Please Note:**
4
# The class name NameIdentifier is being utilized becuase it matches with the DataCite Schema: https://support.datacite.org/docs/datacite-metadata-schema-v44-mandatory-properties#24-nameidentifier
5
# It also matches with the DaCite xml mapping gem that we are utilizing: https://github.com/CDLUC3/datacite-mapping/blob/master/lib/datacite/mapping/name_identifier.rb
6
module PDCMetadata
1✔
7
  # value:      "0000-0001-5000-0007"
8
  # scheme:     "ORCID"
9
  # scheme_uri: "https://orcid.org/""
10
  class NameIdentifier
1✔
11
    attr_accessor :value, :scheme, :scheme_uri
1✔
12
    def initialize(value: nil, scheme: nil, scheme_uri: nil)
1✔
13
      @value = value
35✔
14
      @scheme = scheme
35✔
15
      @scheme_uri = scheme_uri
35✔
16
    end
17

18
    def orcid_url
1✔
19
      return nil unless scheme == "ORCID"
×
20
      "#{scheme_uri}/#{value}"
×
21
    end
22

23
    def orcid
1✔
24
      return nil unless scheme == "ORCID"
20✔
25
      value
20✔
26
    end
27

28
    # Convenience method since this is the most common (only?) identifier that we are currently supporting
29
    def self.new_orcid(value)
1✔
30
      NameIdentifier.new(value: value, scheme: "ORCID", scheme_uri: "https://orcid.org")
35✔
31
    end
32
  end
33
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc