Sha256: 0af9f7b0b1a8c38299b2b41125ece09762747ec84249d4e53adb4658538cb46f

Contents?: true

Size: 894 Bytes

Versions: 29

Compression:

Stored size: 894 Bytes

Contents

require "nokogiri"

module RelatonIetf
  class XMLParser < RelatonBib::XMLParser
    class << self
      private

      # override RelatonBib::BibliographicItem.bib_item method
      # @param item_hash [Hash]
      # @return [RelatonIetf::IetfBibliographicItem]
      def bib_item(item_hash)
        IetfBibliographicItem.new(**item_hash)
      end

      # @param ext [Nokogiri::XML::Element]
      # @return [RelatonBib::EditorialGroup, nil]
      def fetch_editorialgroup(ext)
        return unless ext && (eg = ext.at "editorialgroup")

        eg = eg.xpath("committee").map do |tc|
          wg = RelatonBib::WorkGroup.new(
            name: tc.text, number: tc[:number]&.to_i, type: tc[:type],
            identifier: tc[:identifier], prefix: tc[:prefix]
          )
          Committee.new wg
        end
        RelatonBib::EditorialGroup.new eg if eg.any?
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
relaton-ietf-1.14.4 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.14.3 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.14.2 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.14.1 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.14.0 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.10 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.9 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.8 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.7 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.6 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.5 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.4 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.3 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.2 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.1 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.13.0 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.12.11 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.12.10 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.12.9 lib/relaton_ietf/xml_parser.rb
relaton-ietf-1.12.8 lib/relaton_ietf/xml_parser.rb