Sha256: 4dfba05649577a0dd25ad6e8cea541e4f28d44362820f0642ee2729317fb2cc5
Contents?: true
Size: 1.23 KB
Versions: 50
Compression:
Stored size: 1.23 KB
Contents
module RelatonNist class XMLParser < RelatonBib::XMLParser class << self private # @param intem [Nokogiri::XML::Document] # @return [Hash] def item_data(item) data = super ext = item.at "./ext" return data unless ext data[:commentperiod] = fetch_commentperiod(ext) data end # @param item_hash [Hash] # @return [RelatonNist::NistBibliographicItem] def bib_item(item_hash) NistBibliographicItem.new(**item_hash) end def fetch_status(item) status = item.at "./status" return unless status DocumentStatus.new( stage: status.at("stage")&.text, substage: status.at("substage")&.text, iteration: status.at("iteration")&.text, ) end def fetch_commentperiod(item) cp = item.at "./commentperiod" return unless cp CommentPeriod.new( from: cp.at("from").text, to: cp.at("to")&.text, extended: cp.at("extended")&.text ) end # @param item [Nokogiri::XML::Element] # @return [Array<RelatonBib::DocumentRelation>] def fetch_relations(item) super item, DocumentRelation end end end end
Version data entries
50 entries across 50 versions & 1 rubygems