Class: Relaton::Cie::Processor
- Inherits:
-
Relaton::Core::Processor
- Object
- Relaton::Core::Processor
- Relaton::Cie::Processor
- Defined in:
- lib/relaton/cie/processor.rb
Instance Method Summary collapse
-
#fetch_data(_source, opts) ⇒ Object
Fetch all the docukents from a source.
- #from_xml(xml) ⇒ Relaton::Cie::ItemData
- #from_yaml(yaml) ⇒ Relaton::Cie::ItemData
- #get(code, date, opts) ⇒ Relaton::Cie::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/cie/processor.rb', line 6 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_cie @prefix = "CIE" @defaultprefix = /^CIE(-|\s)/ @idtype = "CIE" @datasets = %w[cie-techstreet] end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the docukents from a source
31 32 33 34 |
# File 'lib/relaton/cie/processor.rb', line 31 def fetch_data(_source, opts) require_relative "data_fetcher" DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ Relaton::Cie::ItemData
38 39 40 41 |
# File 'lib/relaton/cie/processor.rb', line 38 def from_xml(xml) require_relative "../cie" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Cie::ItemData
45 46 47 48 |
# File 'lib/relaton/cie/processor.rb', line 45 def from_yaml(yaml) require_relative "../cie" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Cie::ItemData?
18 19 20 21 |
# File 'lib/relaton/cie/processor.rb', line 18 def get(code, date, opts) require_relative "../cie" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
52 53 54 55 |
# File 'lib/relaton/cie/processor.rb', line 52 def grammar_hash require_relative "../cie" @grammar_hash ||= Cie.grammar_hash end |