Class: PDCMetadata::Funder

Inherits:
Object
  • Object
show all
Defined in:
app/models/pdc_metadata/funder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ror, funder_name, award_number, award_uri) ⇒ Funder

Returns a new instance of Funder.



17
18
19
20
21
22
# File 'app/models/pdc_metadata/funder.rb', line 17

def initialize(ror, funder_name, award_number, award_uri)
  @ror = ror
  @funder_name = funder_name
  @award_number = award_number
  @award_uri = award_uri
end

Instance Attribute Details

#award_numberObject

Returns the value of attribute award_number.



5
6
7
# File 'app/models/pdc_metadata/funder.rb', line 5

def award_number
  @award_number
end

#award_uriObject

Returns the value of attribute award_uri.



5
6
7
# File 'app/models/pdc_metadata/funder.rb', line 5

def award_uri
  @award_uri
end

#funder_nameObject

Returns the value of attribute funder_name.



5
6
7
# File 'app/models/pdc_metadata/funder.rb', line 5

def funder_name
  @funder_name
end

#rorObject

Returns the value of attribute ror.



5
6
7
# File 'app/models/pdc_metadata/funder.rb', line 5

def ror
  @ror
end

Class Method Details

.funder_from_hash(funder) ⇒ Object



8
9
10
11
12
13
14
# File 'app/models/pdc_metadata/funder.rb', line 8

def funder_from_hash(funder)
  ror = funder["ror"]
  funder_name = funder["funder_name"]
  award_number = funder["award_number"]
  award_uri = funder["award_uri"]
  PDCMetadata::Funder.new(ror, funder_name, award_number, award_uri)
end

Instance Method Details

#compare_valueObject



24
25
26
# File 'app/models/pdc_metadata/funder.rb', line 24

def compare_value
  "ROR: #{ror}\nFunder Name: #{funder_name}\nAward Number: #{award_number}\nAward URI: #{award_uri}"
end