diff --git a/lib/orcid/publication_type_mapper.rb b/lib/orcid/publication_type_mapper.rb index 5d538ef60..031fc6045 100644 --- a/lib/orcid/publication_type_mapper.rb +++ b/lib/orcid/publication_type_mapper.rb @@ -22,7 +22,7 @@ def self.to_pub_type(work_type) PUB_TYPE_TO_WORK_TYPE.invert[work_type] end - # @return [String] true if a valid mapped work type. + # @return [String] true if valid mapped work type (from ORCID to sul-pub). def self.work_type?(work_type) PUB_TYPE_TO_WORK_TYPE.value?(work_type) end diff --git a/lib/orcid/work_record.rb b/lib/orcid/work_record.rb index cc5d43e7d..61911b3ea 100644 --- a/lib/orcid/work_record.rb +++ b/lib/orcid/work_record.rb @@ -14,6 +14,11 @@ def put_code @put_code ||= work_response['put-code'] end + # the name of the source that provided the work to ORCID (e.g. "Crossref") + def work_source + @work_source ||= work_response.dig('source','source-name','value') + end + def work_type @work_type ||= work_response['type'] end