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