Skip to content

phluid61/libdoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOI Library

Gem Version Contributor Covenant

The library that lets you do stuff with DOIs.

And stuff.


DOI

Constants

  • VERSION = "1.0.0"

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.

  • prefix: Prepends 'doi:' to the returned string.

doi.to_uri(info: false) → uri

Returns a URI.

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

  • info: Returns an 'info:' URI instead of 'https:'

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages