Method: Orcid::ProfileRequest#xml_payload
- Defined in:
- app/models/orcid/profile_request.rb
#xml_payload(input = attributes) ⇒ Object
NOTE: This one lies ->
http://support.orcid.org/knowledgebase/articles/177522-create-an-id-technical-developer
NOTE: This one was true at 2014-02-06:14:55 ->
http://support.orcid.org/knowledgebase/articles/162412-tutorial-create-a-new-record-using-curl
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'app/models/orcid/profile_request.rb', line 76 def xml_payload(input = attributes) attrs = input.with_indifferent_access returning_value = <<-XML_TEMPLATE <?xml version="1.0" encoding="UTF-8"?> <orcid-message xmlns:xsi="http://www.orcid.org/ns/orcid https://raw.github.com/ORCID/ORCID-Source/master/orcid-model/src/main/resources/orcid-message-1.1.xsd" xmlns="http://www.orcid.org/ns/orcid"> <message-version>1.1</message-version> <orcid-profile> <orcid-bio> <personal-details> <given-names>#{attrs.fetch('given_names')}</given-names> <family-name>#{attrs.fetch('family_name')}</family-name> </personal-details> <contact-details> <email primary="true">#{attrs.fetch('primary_email')}</email> </contact-details> </orcid-bio> </orcid-profile> </orcid-message> XML_TEMPLATE returning_value.strip end |