Class: RelatonBib::Person

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

Overview

Person class.

Instance Attribute Summary collapse

Attributes inherited from Contributor

#contact, #uri

Instance Method Summary collapse

Methods inherited from Contributor

#url

Constructor Details

#initialize(name:, affiliation: [], contact: [], identifier: []) ⇒ Person

Returns a new instance of Person.

Parameters:



114
115
116
117
118
119
# File 'lib/relaton_bib/person.rb', line 114

def initialize(name:, affiliation: [], contact: [], identifier: [])
  super(contact: contact)
  @name        = name
  @affiliation = affiliation
  @identifier = identifier
end

Instance Attribute Details

#affiliationArray<RelatonBib::Affilation>

Returns:



105
106
107
# File 'lib/relaton_bib/person.rb', line 105

def affiliation
  @affiliation
end

#identifierArray<RelatonBib::PersonIdentifier>

Returns:



108
109
110
# File 'lib/relaton_bib/person.rb', line 108

def identifier
  @identifier
end

#nameRelatonBib::FullName



102
103
104
# File 'lib/relaton_bib/person.rb', line 102

def name
  @name
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


122
123
124
125
126
127
128
129
# File 'lib/relaton_bib/person.rb', line 122

def to_xml(builder)
  builder.person do
    name.to_xml builder
    affiliation.each { |a| a.to_xml builder }
    identifier.each { |id| id.to_xml builder }
    contact.each { |contact| contact.to_xml builder }
  end
end