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:, 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.
95 96 97 98 99 100 |
# File 'lib/iso_bib_item/person.rb', line 95 def initialize(name:, affiliation: [], contacts:, identifiers: []) super(contacts: contacts) @name = name @affiliation = affiliation @identifiers = identifiers end |
Instance Attribute Details
#affiliation ⇒ Array<IsoBibItem::Affilation>
88 89 90 |
# File 'lib/iso_bib_item/person.rb', line 88 def affiliation @affiliation end |
#identifiers ⇒ Array<IsoBibItem::PersonIdentifier>
91 92 93 |
# File 'lib/iso_bib_item/person.rb', line 91 def identifiers @identifiers end |
#name ⇒ IsoBibItem::FullName
85 86 87 |
# File 'lib/iso_bib_item/person.rb', line 85 def name @name end |
Instance Method Details
#to_xml(builder) ⇒ Object
103 104 105 106 107 108 109 110 |
# File 'lib/iso_bib_item/person.rb', line 103 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 |