Class: PDCMetadata::Affiliation
- Inherits:
-
Object
- Object
- PDCMetadata::Affiliation
- Defined in:
- app/models/pdc_metadata/affiliation.rb
Overview
value: “datacite” identifier: “ror.org/04aj4c181” scheme: “ROR” scheme_uri: “ror.org/”
Instance Attribute Summary collapse
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#scheme_uri ⇒ Object
Returns the value of attribute scheme_uri.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #compare_value ⇒ Object
- #datacite_attributes ⇒ Object
-
#initialize(value: nil, identifier: nil, scheme: nil, scheme_uri: nil) ⇒ Affiliation
constructor
A new instance of Affiliation.
Constructor Details
#initialize(value: nil, identifier: nil, scheme: nil, scheme_uri: nil) ⇒ Affiliation
Returns a new instance of Affiliation.
10 11 12 13 14 15 |
# File 'app/models/pdc_metadata/affiliation.rb', line 10 def initialize(value: nil, identifier: nil, scheme: nil, scheme_uri: nil) @value = value @identifier = identifier @scheme = scheme @scheme_uri = scheme_uri end |
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
9 10 11 |
# File 'app/models/pdc_metadata/affiliation.rb', line 9 def identifier @identifier end |
#scheme ⇒ Object
Returns the value of attribute scheme.
9 10 11 |
# File 'app/models/pdc_metadata/affiliation.rb', line 9 def scheme @scheme end |
#scheme_uri ⇒ Object
Returns the value of attribute scheme_uri.
9 10 11 |
# File 'app/models/pdc_metadata/affiliation.rb', line 9 def scheme_uri @scheme_uri end |
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'app/models/pdc_metadata/affiliation.rb', line 9 def value @value end |
Class Method Details
.new_affiliation(value:, ror: nil) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/models/pdc_metadata/affiliation.rb', line 30 def self.new_affiliation(value:, ror: nil) scheme = nil identifier = nil if ror.present? scheme = "ROR" identifier = ror end new(value:, scheme:, identifier:, scheme_uri: nil) end |
Instance Method Details
#compare_value ⇒ Object
26 27 28 |
# File 'app/models/pdc_metadata/affiliation.rb', line 26 def compare_value "[#{scheme}:#{value}(#{scheme_uri})](#{identifier})" end |
#datacite_attributes ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/models/pdc_metadata/affiliation.rb', line 17 def datacite_attributes { value:, identifier:, identifier_scheme: scheme, scheme_uri: } end |