Sha256: ad09e066e15de09e35b7489df732e00a6b1ae22bbc2e72a1b1013197028cd6cf

Contents?: true

Size: 734 Bytes

Versions: 22

Compression:

Stored size: 734 Bytes

Contents

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

      # Override RelatonBib::XMLParser.item_data method.
      # @param item [Nokogiri::XML::Element]
      # @returtn [Hash]
      def item_data(item)
        data = super
        ext = item.at "./ext"
        return data unless ext

        data[:committee] = ext.xpath("./committee").map do |c|
          Committee.new(
            type: c[:type], name: c.at("name").text, chair: c.at("chair")&.text
          )
        end
        data
      end

      # @param item_hash [Hash]
      # @return [RelatonIeee::IeeeBibliographicItem]
      def bib_item(item_hash)
        IeeeBibliographicItem.new **item_hash
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
relaton-ieee-1.12.4 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.12.3 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.12.2 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.12.1 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.12.0 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.11.3 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.11.2 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.11.1 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.11.0 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.10.2 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.10.1 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.10.0 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.9.4 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.9.3 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.9.2 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.9.1 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.9.0 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.8.0 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.7.5 lib/relaton_ieee/xml_parser.rb
relaton-ieee-1.7.4 lib/relaton_ieee/xml_parser.rb