Class: Relaton::Itu::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Itu::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) ⇒ Relaton::Itu::ItemData
- #from_yaml(yaml) ⇒ Relaton::Itu::ItemData
- #get(code, date, opts) ⇒ Relaton::Itu::ItemData?
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#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.
6 7 8 9 10 11 12 |
# File 'lib/relaton/itu/processor.rb', line 6 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/
31 32 33 34 |
# File 'lib/relaton/itu/processor.rb', line 31 def fetch_data(source, opts) require_relative "data_fetcher" DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ Relaton::Itu::ItemData
38 39 40 41 |
# File 'lib/relaton/itu/processor.rb', line 38 def from_xml(xml) require_relative "../itu" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Itu::ItemData
45 46 47 48 |
# File 'lib/relaton/itu/processor.rb', line 45 def from_yaml(yaml) require_relative "../itu" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Itu::ItemData?
18 19 20 21 |
# File 'lib/relaton/itu/processor.rb', line 18 def get(code, date, opts) require_relative "../itu" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
52 53 54 55 |
# File 'lib/relaton/itu/processor.rb', line 52 def grammar_hash require_relative "../itu" @grammar_hash ||= Itu.grammar_hash end |