Class: RelatonCalconnect::XMLParser

Inherits:
RelatonBib::XMLParser
  • Object
show all
Defined in:
lib/relaton_calconnect/xml_parser.rb

Class Method Summary collapse

Class Method Details

.bib_item(item_hash) ⇒ RelatonIsoBib::IsoBibliographicItem

override RelatonBib::BibliographicItem.bib_item method

Parameters:

  • item_hash (Hash)

Returns:

  • (RelatonIsoBib::IsoBibliographicItem)


7
8
9
# File 'lib/relaton_calconnect/xml_parser.rb', line 7

def bib_item(item_hash)
  CcBibliographicItem.new **item_hash
end

.fetch_editorialgroup(ext) ⇒ RelatonBib::EditorialGroup?

Parameters:

  • ext (Nokogiri::XML::Element)

Returns:

  • (RelatonBib::EditorialGroup, nil)


13
14
15
16
17
18
19
20
21
22
# File 'lib/relaton_calconnect/xml_parser.rb', line 13

def fetch_editorialgroup(ext)
  return unless ext && (eg = ext.at "editorialgroup")

  eg = eg.xpath("committee", "technical-committee").map do |tc|
    wg = RelatonBib::WorkGroup.new(content: tc.text, number: tc[:number]&.to_i,
                                   type: tc[:type])
    TechnicalCommittee.new wg
  end
  RelatonBib::EditorialGroup.new eg if eg.any?
end