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