Project

pubid-bsi

0.0
The project is in a healthy, maintained state
Library to generate, parse and manipulate ISO PubID.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.0

Runtime

~> 0.2.4
~> 0.3.1
~> 1.12.5
~> 0.7.5
 Project Readme

BSI publication identifiers ("BSI PubID")

Purpose

This gem implements a mechanism to parse and utilize BSI publication identifiers.

Use cases to support

  1. generate updated PubID

Usage

Identifier creation

Basic usage of the pubid-bsi gem starts with the Identifier#create method.

require "pubid-bsi"

pubid = Pubid::Bsi::Identifier.create(number: 1234, part: 1, year: 1999)
pubid.to_s

=> "BS 1234-1:1999"

With document type

pubid = Pubid::Bsi::Identifier.create(type: :pas, number: 1234)
pubid.to_s

=> "PAS 1234"

Identifier’s class and type

Identifier#parse resolves a parsed identifier according to the type.

Pubid::Iso::Identifier.parse("PAS 1234").class
# => Pubid::Bsi::Identifier::PubliclyAvailableSpecification
Pubid::Iso::Identifier.parse("PAS 1234").type
# => {:key=>:pas, :title=>"Publicly Available Specification"}
Pubid::Iso::Identifier.parse("BS 1234").class
# => Pubid::Bsi::Identifier::BritishStandard
Pubid::Iso::Identifier.parse("BS 1234").type
# => {:key=>:bs, :title=>"British Standard"}