Sha256: 75d6f1017cc98f4d307f7a99664a543e7b77258cbd89a4997d5d63acefe1317b

Contents?: true

Size: 1.4 KB

Versions: 21

Compression:

Stored size: 1.4 KB

Contents

require "relaton/processor"
require "relaton_ietf/xml_parser"

module RelatonIetf
  class Processor < Relaton::Processor
    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_ietf
      @prefix = "IETF"
      @defaultprefix = /^(IETF|RFC|BCP)\s/
      @idtype = "IETF"
      @datasets = %w[ietf-rfcsubseries ietf-internet-drafts ietf-rfc-entries]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonIetf::IetfBibliographicItem]
    def get(code, date, opts)
      ::RelatonIetf::IetfBibliography.get(code, date, opts)
    end

    #
    # Fetch all the documents from https://www.rfc-editor.org/rfc-index.xml
    #
    # @param [String] source source name
    # @param [Hash] opts
    # @option opts [String] :output directory to output documents
    # @option opts [String] :format
    #
    def fetch_data(source, opts)
      DataFetcher.fetch(source, **opts)
    end

    # @param xml [String]
    # @return [RelatonIetf::IetfBibliographicItem]
    def from_xml(xml)
      ::RelatonIetf::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonIetf::IetfBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonIetf::IetfBibliographicItem.from_hash hash
    end

    # Returns hash of XML grammar
    # @return [String]
    def grammar_hash
      @grammar_hash ||= ::RelatonIetf.grammar_hash
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
relaton-ietf-1.11.5 lib/relaton_ietf/processor.rb
relaton-ietf-1.11.4 lib/relaton_ietf/processor.rb
relaton-ietf-1.11.3 lib/relaton_ietf/processor.rb
relaton-ietf-1.11.2 lib/relaton_ietf/processor.rb
relaton-ietf-1.11.1 lib/relaton_ietf/processor.rb
relaton-ietf-1.11.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.6 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.5 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.4 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.3 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.2 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.1 lib/relaton_ietf/processor.rb
relaton-ietf-1.10.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.13 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.12 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.11 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.10 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.9 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.8 lib/relaton_ietf/processor.rb
relaton-ietf-1.9.7 lib/relaton_ietf/processor.rb