Sha256: 3427a73077937af2f7814747a2deea64bc43fd3ae08ec7f98ff18468eb1a1f4f

Contents?: true

Size: 851 Bytes

Versions: 14

Compression:

Stored size: 851 Bytes

Contents

module RelatonCalconnect
  class XMLParser < RelatonBib::XMLParser
    class << self
      # override RelatonBib::BibliographicItem.bib_item method
      # @param item_hash [Hash]
      # @return [RelatonIsoBib::IsoBibliographicItem]
      def bib_item(item_hash)
        CcBibliographicItem.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", "technical-committee").map do |tc|
          wg = RelatonBib::WorkGroup.new(name: tc.text, number: tc[:number]&.to_i,
                                         type: tc[:type])
          TechnicalCommittee.new wg
        end
        RelatonBib::EditorialGroup.new eg if eg.any?
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
relaton-calconnect-1.16.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.14.2 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.14.1 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.14.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.13.1 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.13.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.12.1 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.12.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.11.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.10.1 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.10.0 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.9.2 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.9.1 lib/relaton_calconnect/xml_parser.rb
relaton-calconnect-1.9.0 lib/relaton_calconnect/xml_parser.rb