Skip to content

phluid61/libdoi

Repository files navigation

DOI Library

Build Status Gem Version Hound-CI

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages