class RelatonUn::Processor
Attributes
idtype[R]
Public Class Methods
new()
click to toggle source
# File lib/relaton_un/processor.rb, line 7 def initialize @short = :relaton_un @prefix = "UN" @defaultprefix = %r{^UN\s} @idtype = "UN" end
Public Instance Methods
from_xml(xml)
click to toggle source
@param xml [String] @return [RelatonIsoBib::IsoBibliographicItem]
# File lib/relaton_un/processor.rb, line 24 def from_xml(xml) ::RelatonUn::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 [RelatonUn::UnBibliographicItem]
# File lib/relaton_un/processor.rb, line 18 def get(code, date, opts) ::RelatonUn::UnBibliography.get(code, date, opts) end
grammar_hash()
click to toggle source
Returns hash of XML grammar @return [String]
# File lib/relaton_un/processor.rb, line 37 def grammar_hash @grammar_hash ||= ::RelatonUn.grammar_hash end
hash_to_bib(hash)
click to toggle source
@param hash [Hash] @return [RelatonIsoBib::IsoBibliographicItem]
# File lib/relaton_un/processor.rb, line 30 def hash_to_bib(hash) item_hash = ::RelatonUn::HashConverter.hash_to_bib(hash) ::RelatonUn::UnBibliographicItem.new(**item_hash) end