Class: Relaton::Nist::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Nist::Processor
- Defined in:
- lib/relaton/nist/processor.rb
Instance Method Summary collapse
-
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from a source.
- #from_xml(xml) ⇒ Relaton::Nist::ItemData
- #from_yaml(yaml) ⇒ Relaton::Nist::ItemData
- #get(code, date = nil, opts = {}) ⇒ Relaton::Nist::ItemData
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
6 7 8 9 10 11 12 |
# File 'lib/relaton/nist/processor.rb', line 6 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_nist @prefix = "NIST" @defaultprefix = %r{^(NIST|NBS|NISTGCR|ITL Bulletin|JPCRD|NISTIR|CSRC|FIPS)(/[^\s])?\s} @idtype = "NIST" @datasets = %w[nist-tech-pubs] end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from a source
31 32 33 34 |
# File 'lib/relaton/nist/processor.rb', line 31 def fetch_data(_source, opts) require_relative "data_fetcher" DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ Relaton::Nist::ItemData
38 39 40 41 |
# File 'lib/relaton/nist/processor.rb', line 38 def from_xml(xml) require_relative "../nist" Item.from_xml(xml) end |
#from_yaml(yaml) ⇒ Relaton::Nist::ItemData
45 46 47 48 |
# File 'lib/relaton/nist/processor.rb', line 45 def from_yaml(yaml) require_relative "../nist" Item.from_yaml(yaml) end |
#get(code, date = nil, opts = {}) ⇒ Relaton::Nist::ItemData
18 19 20 21 |
# File 'lib/relaton/nist/processor.rb', line 18 def get(code, date = nil, opts = {}) require_relative "../nist" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
52 53 54 55 |
# File 'lib/relaton/nist/processor.rb', line 52 def grammar_hash require_relative "../nist" @grammar_hash ||= Nist.grammar_hash end |