Module: RelatonBib::PersonIdentifierType

Defined in:
lib/relaton_bib/person.rb

Overview

Person identifier type.

Constant Summary collapse

ISNI =
"isni"
ORCID =
"orcid"
URI =
"uri"

Class Method Summary collapse

Class Method Details

.check(type) ⇒ Object

Checks type.

Parameters:

  • type (String)

Raises:

  • (ArgumentError)

    if type isn’t “isni” or “uri”



13
14
15
16
17
18
# File 'lib/relaton_bib/person.rb', line 13

def self.check(type)
  unless [ISNI, ORCID, URI].include? type
    raise ArgumentError, 'Invalid type. It should be "isni", "orcid", "\
      "or "uri".'
  end
end