Sha256: d9e7e4480b4040018218901edc9439d988e26b6513a7a7aec3407711b538b20b

Contents?: true

Size: 1021 Bytes

Versions: 23

Compression:

Stored size: 1021 Bytes

Contents

# frozen_string_literal: true

require "relaton/processor"

module RelatonGb
  class Processor < Relaton::Processor
    def initialize
      @short = :relaton_gb
      @prefix = "CN"
      @defaultprefix = %r{^(GB|GB/T|GB/Z) }
      @idtype = "Chinese Standard"
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonGb::GbBibliographicItem]
    def get(code, date, opts)
      ::RelatonGb::GbBibliography.get(code, date, opts)
    end

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

    # @param hash [Hash]
    # @return [RelatonGb::GbBibliographicItem]
    def hash_to_bib(hash)
      item_hash = ::RelatonGb::HashConverter.hash_to_bib(hash)
      ::RelatonGb::GbBibliographicItem.new item_hash
    end

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

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
relaton-gb-1.7.1 lib/relaton_gb/processor.rb
relaton-gb-1.7.0 lib/relaton_gb/processor.rb
relaton-gb-1.6.0 lib/relaton_gb/processor.rb
relaton-gb-1.6.pre1 lib/relaton_gb/processor.rb
relaton-gb-1.5.0 lib/relaton_gb/processor.rb
relaton-gb-1.5.pre lib/relaton_gb/processor.rb
relaton-gb-1.4.0 lib/relaton_gb/processor.rb
relaton-gb-1.3.0 lib/relaton_gb/processor.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-gb-1.2.0/lib/relaton_gb/processor.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-gb-1.2.0/lib/relaton_gb/processor.rb
relaton-gb-1.2.0 lib/relaton_gb/processor.rb
relaton-gb-1.1.0 lib/relaton_gb/processor.rb
relaton-gb-1.0.2 lib/relaton_gb/processor.rb
relaton-gb-1.0.1 lib/relaton_gb/processor.rb
relaton-gb-1.0.0 lib/relaton_gb/processor.rb
relaton-gb-0.12.0 lib/relaton_gb/processor.rb
relaton-gb-0.11.1 lib/relaton_gb/processor.rb
relaton-gb-0.11.0 lib/relaton_gb/processor.rb
relaton-gb-0.10.0 lib/relaton_gb/processor.rb
relaton-gb-0.9.0 lib/relaton_gb/processor.rb