metanorma / pubid-core

BSD 2-Clause "Simplified" License
1 stars 0 forks source link

= Publication identifiers parsing library

== Usage

=== Exclude attributes when compare

[source,ruby]

require "pubid-core"

pubid_first = Identifier.parse("ISO 1:1999") pubid_second = Identifier.parse("ISO 1")

pubid_first == pubid_second => false

pubid_first.exclude(:year) == pubid_second => true

=== Using #to_h to convert identifier to hash

[source,ruby]

require "pubid-core"

pubid = Identifier.parse("ISO 1:1999") pubid.to_h => { publisher: "ISO", number: 1, year: 1999 }