Method: OrcidClient::Work#insert_contributor

Defined in:
lib/orcid_client/work.rb

#insert_contributor(xml, contributor) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/orcid_client/work.rb', line 158

def insert_contributor(xml, contributor)
  if contributor[:orcid].present?
    xml.send(:'common:contributor-orcid') do
      xml.send(:'common:uri', contributor[:orcid])
      xml.send(:'common:path', validate_orcid(contributor[:orcid]))
      xml.send(:'common:host', 'orcid.org')
    end
  end
  xml.send(:'credit-name', contributor[:credit_name])
  if contributor[:role]
    xml.send(:'contributor-attributes') do
      xml.send(:'contributor-role', contributor[:role])
    end
  end
end