Sha256: 2345b3fd88b3356ec2a6120113ea3ba845e6d677dd7dbdb4765a490286af96da

Contents?: true

Size: 1009 Bytes

Versions: 96

Compression:

Stored size: 1009 Bytes

Contents

require "relaton_bib/technical_committee"

module RelatonBib
  class EditorialGroup
    include RelatonBib

    # @return [Array<RelatonBib::TechnicalCommittee>]
    attr_accessor :technical_committee

    # @param technical_committee [Array<RelatonBib::TechnicalCommittee>]
    def initialize(technical_committee)
      @technical_committee = technical_committee
    end

    # @param builder [Nokogigi::XML::Builder]
    def to_xml(builder)
      builder.editorialgroup do |b|
        technical_committee.each { |tc| tc.to_xml b }
      end
    end

    # @return [Hash]
    def to_hash
      single_element_array technical_committee
    end

    # @param prefix [String]
    # @return [String]
    def to_asciibib(prefix = "")
      pref = prefix.empty? ? "editorialgroup" : "#{prefix}.editorialgroup"
      technical_committee.map do |tc|
        tc.to_asciibib pref, technical_committee.size
      end.join
    end

    # @return [true]
    def presence?
      technical_committee.any?
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
relaton-bib-1.20.2 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.7 lib/relaton_bib/editorial_group.rb
relaton-bib-1.20.1 lib/relaton_bib/editorial_group.rb
relaton-bib-1.20.0 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.6 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.5 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.4 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.3 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.2 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.1 lib/relaton_bib/editorial_group.rb
relaton-bib-1.19.0 lib/relaton_bib/editorial_group.rb
relaton-bib-1.18.5 lib/relaton_bib/editorial_group.rb
relaton-bib-1.18.3 lib/relaton_bib/editorial_group.rb
relaton-bib-1.18.2 lib/relaton_bib/editorial_group.rb
relaton-bib-1.18.1 lib/relaton_bib/editorial_group.rb
relaton-bib-1.18.0 lib/relaton_bib/editorial_group.rb
relaton-bib-1.17.2 lib/relaton_bib/editorial_group.rb
relaton-bib-1.17.1 lib/relaton_bib/editorial_group.rb
relaton-bib-1.17.0 lib/relaton_bib/editorial_group.rb
relaton-bib-1.16.5 lib/relaton_bib/editorial_group.rb