Sha256: 0c1d5086c4c579dffc310db360ca25ad8c026daa9bc2b4f14dc948b0d5cfd2b7

Contents?: true

Size: 1021 Bytes

Versions: 5

Compression:

Stored size: 1021 Bytes

Contents

# frozen_string_literal: true

require 'uri'

module IsoBibItem
  # Contact method.
  class ContactMethod
    # @return [String] @todo TBD
    attr_reader :contact
  end

  # Affilation.
  class Affilation
    # @return [IsoBibItem::LocalizedString]
    attr_reader :name

    # @return [Array<IsoBibItem::FormattedString>]
    attr_reader :description

    # @return [IsoBibItem::Organization]
    attr_reader :organization

    # @param organization [IsoBibItem::Organization]
    def initialize(organization)
      @organization = organization
      @description  = []
    end
  end

  # Contributor.
  class Contributor
    # @return [URI]
    attr_reader :uri

    # @return [Array<IsoBibItem::ContactMethod>]
    attr_reader :contacts

    # @param url [String]
    def initialize(url = nil)
      @uri = URI url if url
      @contacts = []
    end

    # @return [String]
    # def url
    #   @uri.to_s
    # end

    def to_xml(builder)
      contacts.each { |contact| contact.to_xml builder }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
iso-bib-item-0.1.4 lib/iso_bib_item/contributor.rb
iso-bib-item-0.1.3 lib/iso_bib_item/contributor.rb
iso-bib-item-0.1.2 lib/iso_bib_item/contributor.rb
iso-bib-item-0.1.1 lib/iso_bib_item/contributor.rb
iso-bib-item-0.1.0 lib/iso_bib_item/contributor.rb