Sha256: 8012fde26fc9979c99dd4d1f27be30d6ebfa6345d1966e9d20a2ecabe136208c

Contents?: true

Size: 830 Bytes

Versions: 26

Compression:

Stored size: 830 Bytes

Contents

module RelatonUn
  class EditorialGroup
    include RelatonBib

    # @return [Array<String>]
    attr_reader :committee

    # @param committee [Array<String>]
    def initialize(committee)
      @committee = committee
    end

    # @return [true]
    def presence?
      true
    end

    # @param builder [Nokogiri::XML::Builder]
    def to_xml(builder)
      builder.editorialgroup do |b|
        committee.each { |c| b.committee c }
      end
    end

    # @return [Array<Hash>, Hash]
    def to_hash
      single_element_array(committee.map { |c| { "committee" => c } })
    end

    # @param prefix [String]
    # @return [String]
    def to_asciibib(prefix)
      pref = prefix.empty? ? prefix : prefix + "."
      pref += "editorialgroup"
      committee.map { |c| "#{pref}.committee:: #{c}\n" }.join
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
relaton-un-1.20.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.19.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.18.1 lib/relaton_un/editorialgroup.rb
relaton-un-1.18.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.17.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.16.2 lib/relaton_un/editorialgroup.rb
relaton-un-1.16.1 lib/relaton_un/editorialgroup.rb
relaton-un-1.16.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.14.1 lib/relaton_un/editorialgroup.rb
relaton-un-1.14.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.13.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.12.1 lib/relaton_un/editorialgroup.rb
relaton-un-1.12.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.11.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.10.1 lib/relaton_un/editorialgroup.rb
relaton-un-1.10.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.9.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.8.0 lib/relaton_un/editorialgroup.rb
relaton-un-1.7.2 lib/relaton_un/editorialgroup.rb
relaton-un-1.7.1 lib/relaton_un/editorialgroup.rb