Class: Relaton::Calconnect::Processor
- Inherits:
-
Relaton::Core::Processor
- Object
- Relaton::Core::Processor
- Relaton::Calconnect::Processor
- Defined in:
- lib/relaton/calconnect/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 a source.
- #from_xml(xml) ⇒ Relaton::Calconnect::ItemData
- #get(code, date, opts) ⇒ Relaton::Calconnect::ItemData?
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ Relaton::Calconnect::ItemData
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
7 8 9 10 11 12 13 |
# File 'lib/relaton/calconnect/processor.rb', line 7 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_calconnect @prefix = "CC" @defaultprefix = %r{^CC(?!\w)} @idtype = "CC" @datasets = %w[calconnect-org] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton/calconnect/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from a source
32 33 34 35 |
# File 'lib/relaton/calconnect/processor.rb', line 32 def fetch_data(_source, opts) reqire_relative "data_fetcher" DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ Relaton::Calconnect::ItemData
39 40 41 42 |
# File 'lib/relaton/calconnect/processor.rb', line 39 def from_xml(xml) require_relative "../calconnect" Item.from_xml xml end |
#get(code, date, opts) ⇒ Relaton::Calconnect::ItemData?
19 20 21 22 |
# File 'lib/relaton/calconnect/processor.rb', line 19 def get(code, date, opts) require_relative "../calconnect" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
53 54 55 56 |
# File 'lib/relaton/calconnect/processor.rb', line 53 def grammar_hash require_relative "../calconnect" @grammar_hash ||= ::Relaton::Calconnect.grammar_hash end |
#hash_to_bib(hash) ⇒ Relaton::Calconnect::ItemData
46 47 48 49 |
# File 'lib/relaton/calconnect/processor.rb', line 46 def hash_to_bib(hash) require_relative "../calconnect" Item.from_yaml hash.to_yaml end |