class RelatonGb::Processor

Public Class Methods

new() click to toggle source
# File lib/relaton_gb/processor.rb, line 7
def initialize
  @short = :relaton_gb
  @prefix = "CN"
  @defaultprefix = %r{^(GB|GB/T|GB/Z) }
  @idtype = "Chinese Standard"
end

Public Instance Methods

from_xml(xml) click to toggle source

@param xml [String] @return [RelatonGb::GbBibliographicItem]

# File lib/relaton_gb/processor.rb, line 24
def from_xml(xml)
  ::RelatonGb::XMLParser.from_xml xml
end
get(code, date, opts) click to toggle source

@param code [String] @param date [String, NilClass] year @param opts [Hash] @return [RelatonGb::GbBibliographicItem]

# File lib/relaton_gb/processor.rb, line 18
def get(code, date, opts)
  ::RelatonGb::GbBibliography.get(code, date, opts)
end
grammar_hash() click to toggle source

Returns hash of XML grammar @return [String]

# File lib/relaton_gb/processor.rb, line 36
def grammar_hash
  @grammar_hash ||= ::RelatonGb.grammar_hash
end
hash_to_bib(hash) click to toggle source

@param hash [Hash] @return [RelatonGb::GbBibliographicItem]

# File lib/relaton_gb/processor.rb, line 30
def hash_to_bib(hash)
  ::RelatonGb::GbBibliographicItem.new hash
end