Sha256: b883781fd68f4dcb8fba9e054795b54f1d9c1cde8b5f8ce75335b868119e2a75

Contents?: true

Size: 953 Bytes

Versions: 23

Compression:

Stored size: 953 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)
      ::RelatonGb::GbBibliographicItem.new 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 & 1 rubygems

Version Path
relaton-gb-1.20.0 lib/relaton_gb/processor.rb
relaton-gb-1.19.0 lib/relaton_gb/processor.rb
relaton-gb-1.18.4 lib/relaton_gb/processor.rb
relaton-gb-1.18.3 lib/relaton_gb/processor.rb
relaton-gb-1.18.2 lib/relaton_gb/processor.rb
relaton-gb-1.18.1 lib/relaton_gb/processor.rb
relaton-gb-1.18.0 lib/relaton_gb/processor.rb
relaton-gb-1.17.0 lib/relaton_gb/processor.rb
relaton-gb-1.16.3 lib/relaton_gb/processor.rb
relaton-gb-1.16.2 lib/relaton_gb/processor.rb
relaton-gb-1.16.1 lib/relaton_gb/processor.rb
relaton-gb-1.16.0 lib/relaton_gb/processor.rb
relaton-gb-1.14.0 lib/relaton_gb/processor.rb
relaton-gb-1.13.0 lib/relaton_gb/processor.rb
relaton-gb-1.12.1 lib/relaton_gb/processor.rb
relaton-gb-1.12.0 lib/relaton_gb/processor.rb
relaton-gb-1.11.0 lib/relaton_gb/processor.rb
relaton-gb-1.10.1 lib/relaton_gb/processor.rb
relaton-gb-1.10.0 lib/relaton_gb/processor.rb
relaton-gb-1.9.0 lib/relaton_gb/processor.rb