Class: RelatonCen::Processor

Inherits:
Relaton::Processor
  • Object
show all
Defined in:
lib/relaton_cen/processor.rb

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



5
6
7
8
9
10
# File 'lib/relaton_cen/processor.rb', line 5

def initialize # rubocop:disable Lint/MissingSuper
  @short = :relaton_cen
  @prefix = "CEN"
  @defaultprefix = %r{^(C?EN|ENV|CWA|HD|CR)[\s/]}
  @idtype = "CEN"
end

Instance Method Details

#from_xml(xml) ⇒ RelatonBib::BibliographicItem

Parameters:

  • xml (String)

Returns:

  • (RelatonBib::BibliographicItem)


22
23
24
# File 'lib/relaton_cen/processor.rb', line 22

def from_xml(xml)
  ::RelatonCen::XMLParser.from_xml xml
end

#get(code, date, opts) ⇒ RelatonBib::BibliographicItem

Parameters:

  • code (String)
  • date (String, NilClass)

    year

  • opts (Hash)

Returns:

  • (RelatonBib::BibliographicItem)


16
17
18
# File 'lib/relaton_cen/processor.rb', line 16

def get(code, date, opts)
  ::RelatonCen::CenBibliography.get(code, date, opts)
end

#grammar_hashString

Returns hash of XML grammar

Returns:

  • (String)


34
35
36
# File 'lib/relaton_cen/processor.rb', line 34

def grammar_hash
  @grammar_hash ||= ::RelatonCen.grammar_hash
end

#hash_to_bib(hash) ⇒ RelatonBib::BibliographicItem

Parameters:

  • hash (Hash)

Returns:

  • (RelatonBib::BibliographicItem)


28
29
30
# File 'lib/relaton_cen/processor.rb', line 28

def hash_to_bib(hash)
  ::RelatonCen::BibliographicItem.from_hash hash
end