Class: Relaton::Ietf::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Ietf::Processor
- Defined in:
- lib/relaton/ietf/processor.rb
Instance Method Summary collapse
-
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from www.rfc-editor.org/rfc-index.xml.
- #from_xml(xml) ⇒ Relaton::Ietf::ItemData
- #from_yaml(yaml) ⇒ Relaton::Ietf::ItemData
- #get(code, date, opts) ⇒ Relaton::Ietf::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/ietf/processor.rb', line 6 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_ietf @prefix = "IETF" @defaultprefix = /^((IETF|RFC|BCP|FYI|STD)\s|I-D[.\s])/ @idtype = "IETF" @datasets = %w[ietf-rfcsubseries ietf-internet-drafts ietf-rfc-entries] end |
Instance Method Details
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from www.rfc-editor.org/rfc-index.xml
31 32 33 34 |
# File 'lib/relaton/ietf/processor.rb', line 31 def fetch_data(source, opts) require_relative "data_fetcher" DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ Relaton::Ietf::ItemData
38 39 40 41 |
# File 'lib/relaton/ietf/processor.rb', line 38 def from_xml(xml) require_relative "../ietf" Item.from_xml xml end |
#from_yaml(yaml) ⇒ Relaton::Ietf::ItemData
45 46 47 48 |
# File 'lib/relaton/ietf/processor.rb', line 45 def from_yaml(yaml) require_relative "../ietf" Item.from_yaml yaml end |
#get(code, date, opts) ⇒ Relaton::Ietf::ItemData?
18 19 20 21 |
# File 'lib/relaton/ietf/processor.rb', line 18 def get(code, date, opts) require_relative "../ietf" Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
52 53 54 55 |
# File 'lib/relaton/ietf/processor.rb', line 52 def grammar_hash require_relative "../ietf" @grammar_hash ||= ::Relaton::Ietf.grammar_hash end |
#remove_index_file ⇒ Object
Remove index file
60 61 62 63 64 65 |
# File 'lib/relaton/ietf/processor.rb', line 60 def remove_index_file require_relative "../ietf" Relaton::Index.find_or_create(:RFC, url: true, file: "#{INDEXFILE}.yaml").remove_file Relaton::Index.find_or_create(:RSS, url: true, file: "#{INDEXFILE}.yaml").remove_file Relaton::Index.find_or_create(:IDS, url: true, file: "#{INDEXFILE}.yaml").remove_file end |