Class: RelatonBib::PersonIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_bib/person.rb

Overview

Person identifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ PersonIdentifier

Returns a new instance of PersonIdentifier.



86
87
88
89
90
91
# File 'lib/relaton_bib/person.rb', line 86

def initialize(type, value)
  PersonIdentifierType.check type

  @type  = type
  @value = value
end

Instance Attribute Details

#typeRelatonBib::PersonIdentifierType::ISNI, RelatonBib::PersonIdentifierType::URI



79
80
81
# File 'lib/relaton_bib/person.rb', line 79

def type
  @type
end

#valueString

Returns:

  • (String)


82
83
84
# File 'lib/relaton_bib/person.rb', line 82

def value
  @value
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builser (Nokogiri::XML::Builder)


94
95
96
# File 'lib/relaton_bib/person.rb', line 94

def to_xml(builder)
  builder.identifier value, type: type
end