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

pulibrary / pdc_describe / cace366a-ffad-45f1-9b60-678e607fa527

14 May 2024 02:21PM UTC coverage: 60.862% (-35.0%) from 95.908%
cace366a-ffad-45f1-9b60-678e607fa527

push

circleci

jrgriffiniii
wip

1 of 3 new or added lines in 2 files covered. (33.33%)

1194 existing lines in 57 files now uncovered.

2076 of 3411 relevant lines covered (60.86%)

22.71 hits per line

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

63.16
/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
7✔
12
      @identifier = identifier
7✔
13
      @scheme = scheme
7✔
14
      @scheme_uri = scheme_uri
7✔
15
    end
16

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

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

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