Sha256: 3e70825ab740d440b320a79501f2622adfb4cefc30b3bd348e772954d4fc430a
Contents?: true
Size: 662 Bytes
Versions: 1
Compression:
Stored size: 662 Bytes
Contents
require 'rest-client' class Datacite ENDPOINT = 'https://mds.datacite.org' TEST_ENDPOINT = 'https://test.datacite.org/mds' def initialize(user_name, password, endpoint = nil) endpoint ||= ENDPOINT @endpoint = RestClient::Resource.new(endpoint, user_name, password) end def resolve(doi) @endpoint["doi/#{doi}"].get end def mint(doi, url) @endpoint['doi'].post("doi=#{doi}\nurl=#{url}", content_type: 'text/plain;charset=UTF-8') end def upload_metadata(metadata) @endpoint['metadata'].post(metadata, content_type: 'application/xml;charset=UTF-8') end def metadata(doi) @endpoint["metadata/#{doi}"].get end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
datacite_doi_ify-1.1.0 | lib/datacite_doi_ify/datacite.rb |