Class: RelatonBib::Person
- Inherits:
-
Contributor
- Object
- Contributor
- RelatonBib::Person
- Defined in:
- lib/relaton_bib/person.rb
Overview
Person class.
Instance Attribute Summary collapse
- #affiliation ⇒ Array<RelatonBib::Affilation>
- #identifiers ⇒ Array<RelatonBib::PersonIdentifier>
- #name ⇒ RelatonBib::FullName
Attributes inherited from Contributor
Instance Method Summary collapse
-
#initialize(name:, affiliation: [], contacts: [], identifiers: []) ⇒ Person
constructor
A new instance of Person.
- #to_xml(builder) ⇒ Object
Methods inherited from Contributor
Constructor Details
#initialize(name:, affiliation: [], contacts: [], identifiers: []) ⇒ Person
Returns a new instance of Person.
143 144 145 146 147 148 |
# File 'lib/relaton_bib/person.rb', line 143 def initialize(name:, affiliation: [], contacts: [], identifiers: []) super(contacts: contacts) @name = name @affiliation = affiliation @identifiers = identifiers end |
Instance Attribute Details
#affiliation ⇒ Array<RelatonBib::Affilation>
134 135 136 |
# File 'lib/relaton_bib/person.rb', line 134 def affiliation @affiliation end |
#identifiers ⇒ Array<RelatonBib::PersonIdentifier>
137 138 139 |
# File 'lib/relaton_bib/person.rb', line 137 def identifiers @identifiers end |
#name ⇒ RelatonBib::FullName
131 132 133 |
# File 'lib/relaton_bib/person.rb', line 131 def name @name end |
Instance Method Details
#to_xml(builder) ⇒ Object
151 152 153 154 155 156 157 158 |
# File 'lib/relaton_bib/person.rb', line 151 def to_xml(builder) builder.person do name.to_xml builder affiliation.each { |a| a.to_xml builder } identifiers.each { |id| id.to_xml builder } contacts.each { |contact| contact.to_xml builder } end end |