Class: Relaton::Etsi::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Etsi::Processor
- Defined in:
- lib/relaton/etsi/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.etsi.org.
- #from_xml(xml) ⇒ Relaton::Etsi::Item
- #from_yaml(yaml) ⇒ Relaton::Etsi::Item
- #get(code, date, opts) ⇒ Relaton::Etsi::Item
-
#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
8 9 10 11 12 13 14 |
# File 'lib/relaton/etsi/processor.rb', line 8 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_etsi @prefix = "ETSI" @defaultprefix = %r{^ETSI\s} @idtype = "ETSI" @datasets = %w[etsi-csv] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
6 7 8 |
# File 'lib/relaton/etsi/processor.rb', line 6 def idtype @idtype end |
Instance Method Details
#fetch_data(_source, opts) ⇒ Object
Fetch all the documents from www.etsi.org
33 34 35 36 |
# File 'lib/relaton/etsi/processor.rb', line 33 def fetch_data(_source, opts) require_relative "data_fetcher" DataFetcher.fetch(**opts) end |
#from_xml(xml) ⇒ Relaton::Etsi::Item
40 41 42 43 |
# File 'lib/relaton/etsi/processor.rb', line 40 def from_xml(xml) require_relative "../etsi" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Etsi::Item
47 48 49 50 |
# File 'lib/relaton/etsi/processor.rb', line 47 def from_yaml(yaml) require_relative "../etsi" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Etsi::Item
20 21 22 23 |
# File 'lib/relaton/etsi/processor.rb', line 20 def get(code, date, opts) require_relative "../etsi" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
54 55 56 57 58 |
# File 'lib/relaton/etsi/processor.rb', line 54 def grammar_hash require "relaton/bib/version" require_relative "version" Digest::MD5.hexdigest Relaton::Etsi::VERSION + Relaton::Bib::VERSION end |
#remove_index_file ⇒ Object
Remove index file
63 64 65 66 |
# File 'lib/relaton/etsi/processor.rb', line 63 def remove_index_file require_relative "../etsi" Relaton::Index.find_or_create(:etsi, url: true, file: INDEX_FILE).remove_file end |