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

pulibrary / pdc_describe / 9091a1ae-29be-458c-984a-339d213919c4

12 Dec 2024 07:41PM UTC coverage: 26.434% (-69.7%) from 96.113%
9091a1ae-29be-458c-984a-339d213919c4

Pull #2000

circleci

jrgriffiniii
Removing integration with ActiveStorage
Pull Request #2000: Bump actionpack from 7.2.1.1 to 7.2.2.1

945 of 3575 relevant lines covered (26.43%)

0.35 hits per line

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

36.84
/app/models/pdc_metadata/affiliation.rb
1
# frozen_string_literal: true
2
# Class for storing an affiliation in our local representation
3
module PDCMetadata
1✔
4
  # value:      "datacite"
5
  # identifier: "https://ror.org/04aj4c181"
6
  # scheme:     "ROR"
7
  # scheme_uri: "https://ror.org/"
8
  class Affiliation
1✔
9
    attr_accessor :value, :identifier, :scheme, :scheme_uri
1✔
10
    def initialize(value: nil, identifier: nil, scheme: nil, scheme_uri: nil)
1✔
11
      @value = value
×
12
      @identifier = identifier
×
13
      @scheme = scheme
×
14
      @scheme_uri = scheme_uri
×
15
    end
16

17
    def datacite_attributes
1✔
18
      {
19
        value:,
×
20
        identifier:,
21
        identifier_scheme: scheme,
22
        scheme_uri:
23
      }
24
    end
25

26
    def compare_value
1✔
27
      "[#{scheme}:#{value}(#{scheme_uri})](#{identifier})"
×
28
    end
29

30
    def self.new_affiliation(value:, ror: nil)
1✔
31
      scheme = nil
×
32
      identifier = nil
×
33
      if ror.present?
×
34
        scheme = "ROR"
×
35
        identifier = ror
×
36
      end
37
      new(value:, scheme:, identifier:, scheme_uri: nil)
×
38
    end
39
  end
40
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