Sha256: dd11039b679f83a2df5f1c44187d42f77e76a9817350fad247c75eb8d25169dd

Contents?: true

Size: 873 Bytes

Versions: 5

Compression:

Stored size: 873 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 }
      @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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
relaton-gb-0.6.7 lib/relaton_gb/processor.rb
relaton-gb-0.6.6 lib/relaton_gb/processor.rb
relaton-gb-0.6.5 lib/relaton_gb/processor.rb
relaton-gb-0.6.4 lib/relaton_gb/processor.rb
relaton-gb-0.6.3 lib/relaton_gb/processor.rb