Class: RelatonIso::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonIso::Processor
- Defined in:
- lib/relaton_iso/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
-
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from www.iso.org/standards-catalogue/browse-by-ics.html.
- #from_xml(xml) ⇒ RelatonIsoBib::IsoBibliographicItem
- #get(code, date, opts) ⇒ RelatonIsoBib::IsoBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonIsoBib::IsoBibliographicItem
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
-
#remove_index_file ⇒ Object
Remove index file.
-
#threads ⇒ Integer
Returns number of workers.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
7 8 9 10 11 12 13 |
# File 'lib/relaton_iso/processor.rb', line 7 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_iso @prefix = "ISO" @defaultprefix = %r{^ISO(/IEC)?\s} @idtype = "ISO" @datasets = %w[iso-ics] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_iso/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from www.iso.org/standards-catalogue/browse-by-ics.html
31 32 33 |
# File 'lib/relaton_iso/processor.rb', line 31 def fetch_data(_source, opts) DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ RelatonIsoBib::IsoBibliographicItem
37 38 39 |
# File 'lib/relaton_iso/processor.rb', line 37 def from_xml(xml) ::RelatonIsoBib::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonIsoBib::IsoBibliographicItem
19 20 21 |
# File 'lib/relaton_iso/processor.rb', line 19 def get(code, date, opts) ::RelatonIso::IsoBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
50 51 52 |
# File 'lib/relaton_iso/processor.rb', line 50 def grammar_hash @grammar_hash ||= ::RelatonIsoBib.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonIsoBib::IsoBibliographicItem
43 44 45 46 |
# File 'lib/relaton_iso/processor.rb', line 43 def hash_to_bib(hash) item_hash = HashConverter.hash_to_bib(hash) ::RelatonIsoBib::IsoBibliographicItem.new(**item_hash) end |
#remove_index_file ⇒ Object
Remove index file
63 64 65 |
# File 'lib/relaton_iso/processor.rb', line 63 def remove_index_file Relaton::Index.find_or_create(:iso, url: true, file: HitCollection::INDEXFILE).remove_file end |
#threads ⇒ Integer
Returns number of workers
56 57 58 |
# File 'lib/relaton_iso/processor.rb', line 56 def threads 3 end |