Sha256: 644d173f202a4e7d2628b519b407e51fe34acd0680704ee9b7580cc47ad5075b

Contents?: true

Size: 1.39 KB

Versions: 14

Compression:

Stored size: 1.39 KB

Contents

require "relaton/processor"

module RelatonIana
  class Processor < Relaton::Processor
    attr_reader :idtype

    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_iana
      @prefix = "IANA"
      @defaultprefix = %r{^IANA\s}
      @idtype = "IANA"
      @datasets = %w[iana-registries]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonBib::BibliographicItem]
    def get(code, date, opts)
      ::RelatonIana::IanaBibliography.get(code, date, opts)
    end

    #
    # Fetch all the documents from https://github.com/ietf-ribose/iana-registries
    #
    # @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(**opts)
    end

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

    # @param hash [Hash]
    # @return [RelatonIana::BibliographicItem]
    def hash_to_bib(hash)
      item_hash = ::RelatonBib::HashConverter.hash_to_bib(hash)
      ::RelatonWBib::BibliographicItem.new(**item_hash)
    end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
relaton-iana-1.13.1 lib/relaton_iana/processor.rb
relaton-iana-1.13.0 lib/relaton_iana/processor.rb
relaton-iana-1.12.5 lib/relaton_iana/processor.rb
relaton-iana-1.12.4 lib/relaton_iana/processor.rb
relaton-iana-1.12.3 lib/relaton_iana/processor.rb
relaton-iana-1.12.2 lib/relaton_iana/processor.rb
relaton-iana-1.12.1 lib/relaton_iana/processor.rb
relaton-iana-1.12.0 lib/relaton_iana/processor.rb
relaton-iana-1.11.0 lib/relaton_iana/processor.rb
relaton-iana-1.10.3 lib/relaton_iana/processor.rb
relaton-iana-1.10.2 lib/relaton_iana/processor.rb
relaton-iana-1.10.1 lib/relaton_iana/processor.rb
relaton-iana-1.10.0 lib/relaton_iana/processor.rb
relaton-iana-1.9.2 lib/relaton_iana/processor.rb