class RelatonNist::Processor

Public Class Methods

new() click to toggle source
# File lib/relaton_nist/processor.rb, line 5
def initialize
  @short = :relaton_nist
  @prefix = "NIST"
  @defaultprefix = %r{^(NIST|NISTGCR|ITL Bulletin|JPCRD|NISTIR|CSRC|FIPS)(/[^\s])?\s}
  @idtype = "NIST"
  @datasets = %w[nist-tech-pubs]
end

Public Instance Methods

fetch_data(_source, opts) click to toggle source
# File lib/relaton_nist/processor.rb, line 21
def fetch_data(_source, opts)
  DataFetcher.fetch(**opts)
end
from_xml(xml) click to toggle source

@param xml [String] @return [RelatonNist::GbBibliographicItem]

# File lib/relaton_nist/processor.rb, line 27
def from_xml(xml)
  ::RelatonNist::XMLParser.from_xml xml
end
get(code, date = nil, opts = {}) click to toggle source

@param code [String] @param date [String, NilClass] year @param opts [Hash] @return [RelatonNist::GbBibliographicItem]

# File lib/relaton_nist/processor.rb, line 17
def get(code, date = nil, opts = {})
  ::RelatonNist::NistBibliography.get(code, date, opts)
end
grammar_hash() click to toggle source

Returns hash of XML grammar @return [String]

# File lib/relaton_nist/processor.rb, line 39
def grammar_hash
  @grammar_hash ||= ::RelatonNist.grammar_hash
end
hash_to_bib(hash) click to toggle source

@param hash [Hash] @return [RelatonNist::GbBibliographicItem]

# File lib/relaton_nist/processor.rb, line 33
def hash_to_bib(hash)
  ::RelatonNist::NistBibliographicItem.from_hash hash
end