Class: RelatonBib::PersonIdentifier
Overview
Person identifier.
Instance Attribute Summary collapse
- #type ⇒ RelatonBib::PersonIdentifierType::ISNI, RelatonBib::PersonIdentifierType::URI
- #value ⇒ String
Instance Method Summary collapse
-
#initialize(type, value) ⇒ PersonIdentifier
constructor
A new instance of PersonIdentifier.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(type, value) ⇒ PersonIdentifier
Returns a new instance of PersonIdentifier.
100 101 102 103 104 105 |
# File 'lib/relaton_bib/person.rb', line 100 def initialize(type, value) PersonIdentifierType.check type @type = type @value = value end |
Instance Attribute Details
#type ⇒ RelatonBib::PersonIdentifierType::ISNI, RelatonBib::PersonIdentifierType::URI
93 94 95 |
# File 'lib/relaton_bib/person.rb', line 93 def type @type end |
#value ⇒ String
96 97 98 |
# File 'lib/relaton_bib/person.rb', line 96 def value @value end |
Instance Method Details
#to_hash ⇒ Hash
113 114 115 |
# File 'lib/relaton_bib/person.rb', line 113 def to_hash { "type" => type, "id" => value } end |
#to_xml(builder) ⇒ Object
108 109 110 |
# File 'lib/relaton_bib/person.rb', line 108 def to_xml(builder) builder.identifier value, type: type end |