Class: RelatonItu::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonItu::Processor
- Defined in:
- lib/relaton_itu/processor.rb
Instance Method Summary collapse
-
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from extranet.itu.int/brdocsearch/.
- #from_xml(xml) ⇒ RelatonItu::ItuBibliographicItem
- #get(code, date, opts) ⇒ RelatonItu::ItuBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonItu::ItuBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
5 6 7 8 9 10 11 |
# File 'lib/relaton_itu/processor.rb', line 5 def initialize @short = :relaton_itu @prefix = "ITU" @defaultprefix = %r{^ITU\s} @idtype = "ITU" @datasets = %w[itu-r] end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from extranet.itu.int/brdocsearch/
29 30 31 |
# File 'lib/relaton_itu/processor.rb', line 29 def fetch_data(_source, opts) DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ RelatonItu::ItuBibliographicItem
35 36 37 |
# File 'lib/relaton_itu/processor.rb', line 35 def from_xml(xml) ::RelatonItu::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonItu::ItuBibliographicItem
17 18 19 |
# File 'lib/relaton_itu/processor.rb', line 17 def get(code, date, opts) ::RelatonItu::ItuBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
47 48 49 |
# File 'lib/relaton_itu/processor.rb', line 47 def grammar_hash @grammar_hash ||= ::RelatonItu.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonItu::ItuBibliographicItem
41 42 43 |
# File 'lib/relaton_itu/processor.rb', line 41 def hash_to_bib(hash) ::RelatonItu::ItuBibliographicItem.from_hash hash end |
#remove_index_file ⇒ Object
Remove index file
54 55 56 |
# File 'lib/relaton_itu/processor.rb', line 54 def remove_index_file Relaton::Index.find_or_create(:itu, url: true, file: HitCollection::INDEX_FILE).remove_file end |