Class: IsoBibItem::Contributor
- Inherits:
-
Object
- Object
- IsoBibItem::Contributor
- Defined in:
- lib/iso_bib_item/contributor.rb
Overview
Contributor.
Direct Known Subclasses
Instance Attribute Summary collapse
- #contacts ⇒ Array<IsoBibItem::Address, IsoBibItem::Phone> readonly
- #uri ⇒ URI readonly
Instance Method Summary collapse
-
#initialize(url: nil, contacts: []) ⇒ Contributor
constructor
A new instance of Contributor.
- #to_xml(builder) ⇒ Object
- #url ⇒ String
Constructor Details
#initialize(url: nil, contacts: []) ⇒ Contributor
Returns a new instance of Contributor.
105 106 107 108 |
# File 'lib/iso_bib_item/contributor.rb', line 105 def initialize(url: nil, contacts: []) @uri = URI url if url @contacts = contacts end |
Instance Attribute Details
#contacts ⇒ Array<IsoBibItem::Address, IsoBibItem::Phone> (readonly)
101 102 103 |
# File 'lib/iso_bib_item/contributor.rb', line 101 def contacts @contacts end |
#uri ⇒ URI (readonly)
98 99 100 |
# File 'lib/iso_bib_item/contributor.rb', line 98 def uri @uri end |
Instance Method Details
#to_xml(builder) ⇒ Object
116 117 118 |
# File 'lib/iso_bib_item/contributor.rb', line 116 def to_xml(builder) contacts.each { |contact| contact.to_xml builder } end |
#url ⇒ String
111 112 113 |
# File 'lib/iso_bib_item/contributor.rb', line 111 def url @uri.to_s end |