Sha256: 56963f58fa6c6eb7db634e609017f1d6b9bcd499467ea8c6cc0f5837dad125a2

Contents?: true

Size: 1.01 KB

Versions: 35

Compression:

Stored size: 1.01 KB

Contents

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

module RelatonIetf
  class Processor < Relaton::Processor
    def initialize
      @short = :relaton_ietf
      @prefix = "IETF"
      @defaultprefix = /^RFC /
      @idtype = "IETF"
    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

    # @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)
      item_hash = ::RelatonIetf::HashConverter.hash_to_bib(hash)
      ::RelatonIetf::IetfBibliographicItem.new item_hash
    end

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

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
relaton-ietf-1.7.3 lib/relaton_ietf/processor.rb
relaton-ietf-1.7.2 lib/relaton_ietf/processor.rb
relaton-ietf-1.7.1 lib/relaton_ietf/processor.rb
relaton-ietf-1.7.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.6.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.6.pre1 lib/relaton_ietf/processor.rb
relaton-ietf-1.5.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.5.pre lib/relaton_ietf/processor.rb
relaton-ietf-1.4.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.3.0 lib/relaton_ietf/processor.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-ietf-1.2.1/lib/relaton_ietf/processor.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-ietf-1.2.1/lib/relaton_ietf/processor.rb
relaton-ietf-1.2.1 lib/relaton_ietf/processor.rb
relaton-ietf-1.2.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.1.4 lib/relaton_ietf/processor.rb
relaton-ietf-1.1.3 lib/relaton_ietf/processor.rb
relaton-ietf-1.1.2 lib/relaton_ietf/processor.rb
relaton-ietf-1.1.1 lib/relaton_ietf/processor.rb
relaton-ietf-1.1.0 lib/relaton_ietf/processor.rb
relaton-ietf-1.0.4 lib/relaton_ietf/processor.rb