Class: Relaton3gpp::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- Relaton3gpp::Processor
- Defined in:
- lib/relaton_3gpp/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 xml2rfc.tools.ietf.org/public/rfc/bibxml-3gpp-new/.
- #from_xml(xml) ⇒ RelatonBib::BibliographicItem
- #get(code, date, opts) ⇒ RelatonBib::BibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonBib::BibliographicItem
-
#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_3gpp/processor.rb', line 7 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_3gpp @prefix = "3GPP" @defaultprefix = %r{^3GPP\s} @idtype = "3GPP" @datasets = %w[status-smg-3GPP status-smg-3GPP-force] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_3gpp/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#fetch_data(source, opts) ⇒ Object
Fetch all the documents from xml2rfc.tools.ietf.org/public/rfc/bibxml-3gpp-new/
31 32 33 |
# File 'lib/relaton_3gpp/processor.rb', line 31 def fetch_data(source, opts) DataFetcher.fetch(source, **opts) end |
#from_xml(xml) ⇒ RelatonBib::BibliographicItem
37 38 39 |
# File 'lib/relaton_3gpp/processor.rb', line 37 def from_xml(xml) ::Relaton3gpp::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonBib::BibliographicItem
19 20 21 |
# File 'lib/relaton_3gpp/processor.rb', line 19 def get(code, date, opts) ::Relaton3gpp::Bibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
50 51 52 |
# File 'lib/relaton_3gpp/processor.rb', line 50 def grammar_hash @grammar_hash ||= ::Relaton3gpp.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonBib::BibliographicItem
43 44 45 46 |
# File 'lib/relaton_3gpp/processor.rb', line 43 def hash_to_bib(hash) item_hash = ::Relaton3gpp::HashConverter.hash_to_bib(hash) ::Relaton3gpp::BibliographicItem.new(**item_hash) end |
#remove_index_file ⇒ Object
Remove index file
57 58 59 |
# File 'lib/relaton_3gpp/processor.rb', line 57 def remove_index_file Relaton::Index.find_or_create("3GPP", url: true, file: Bibliography::INDEX_FILE).remove_file end |