DOI Library

Gem Version Contributor Covenant

The library that lets you do stuff with DOIs.

And stuff.


DOI

Constants

Class Methods

DOI::parse(str) → doi

Parses the given string as a DOI.

Raises an ArgumentError if parsing fails.

DOI::find(doi) → uri

Looks for a DOI at doi.org.

Returns a URI if it finds a match, otherwise returns nil.

require 'doi/network'

url = DOI.find('10.17487/RFC8089')

DOI::data(doi) → hash

Gets data about a DOI from CrossRef.

require 'doi/network'

data = DOI.data('10.17487/RFC8089')

Instance Methods

doi + other → new_doi

Concatenation--Returns a new DOI containing other concatenated to this DOI's suffix string.

doi << other → doi

Append--Concatenates the given object to this DOI's suffix string.

doi.to_s(prefix: true) → str

Returns a String that represents this DOI.

doi.to_uri(info: false) → uri

Returns a URI.

For example: "https://doi.org/10.1000/foo%23bar"

doi.find → uri

Looks for a DOI at doi.org.

Returns a URI if it finds a match, otherwise returns nil.

require 'doi/network'

url = DOI.parse('10.17487/RFC8089').find

doi.data → hash

Gets data about this DOI from CrossRef.

require 'doi/network'

data = DOI.parse('10.17487/RFC8089').data

Contributing

We require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.

Contributor Code of Conduct

This repository is subject to a Contributor Code of Conduct adapted from the Contributor Covenant, version 3.0, available at https://www.contributor-covenant.org/version/3/0/

Licence

This project is licensed under the ISC licence. See LICENSE for details

Copyright (c) 2017, Matthew Kerwin <matthew@kerwin.net.au>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.