Class: IsoBibItem::Person
- Inherits:
-
Contributor
- Object
- Contributor
- IsoBibItem::Person
- Defined in:
- lib/iso_bib_item/person.rb
Overview
Person class.
Instance Attribute Summary collapse
- #affiliation ⇒ Array<IsoBibItem::Affilation>
- #identifiers ⇒ Array<IsoBibItem::PersonIdentifier>
- #name ⇒ IsoBibItem::FullName
Attributes inherited from Contributor
Instance Method Summary collapse
-
#initialize(name:, affiliation: [], contacts:) ⇒ Person
constructor
A new instance of Person.
- #to_xml(builder) ⇒ Object
Methods inherited from Contributor
Constructor Details
#initialize(name:, affiliation: [], contacts:) ⇒ Person
Returns a new instance of Person.
91 92 93 94 95 96 |
# File 'lib/iso_bib_item/person.rb', line 91 def initialize(name:, affiliation: [], contacts:) super(contacts: contacts) @name = name @affiliation = affiliation @identifiers = [] end |
Instance Attribute Details
#affiliation ⇒ Array<IsoBibItem::Affilation>
84 85 86 |
# File 'lib/iso_bib_item/person.rb', line 84 def affiliation @affiliation end |
#identifiers ⇒ Array<IsoBibItem::PersonIdentifier>
87 88 89 |
# File 'lib/iso_bib_item/person.rb', line 87 def identifiers @identifiers end |
#name ⇒ IsoBibItem::FullName
81 82 83 |
# File 'lib/iso_bib_item/person.rb', line 81 def name @name end |
Instance Method Details
#to_xml(builder) ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/iso_bib_item/person.rb', line 99 def to_xml(builder) builder.person do name.to_xml builder affiliation.each { |a| a.to_xml builder } contacts.each { |contact| contact.to_xml builder } end end |