Class: IsoBibItem::Contributor

Inherits:
Object
  • Object
show all
Defined in:
lib/iso_bib_item/contributor.rb

Overview

Contributor.

Direct Known Subclasses

Organization, Person

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url: nil, contacts: []) ⇒ Contributor

Returns a new instance of Contributor.

Parameters:



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

#contactsArray<IsoBibItem::Address, IsoBibItem::Phone> (readonly)

Returns:



101
102
103
# File 'lib/iso_bib_item/contributor.rb', line 101

def contacts
  @contacts
end

#uriURI (readonly)

Returns:

  • (URI)


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

#urlString

Returns:

  • (String)


111
112
113
# File 'lib/iso_bib_item/contributor.rb', line 111

def url
  @uri.to_s
end