Class: Relaton::Cen::Processor

Inherits:
Relaton::Core::Processor
  • Object
show all
Defined in:
lib/relaton/cen/processor.rb

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



6
7
8
9
10
11
# File 'lib/relaton/cen/processor.rb', line 6

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)


23
24
25
# File 'lib/relaton/cen/processor.rb', line 23

def from_xml(xml)
  Item.from_xml xml
end

#from_yaml(yaml) ⇒ RelatonBib::BibliographicItem

Parameters:

  • yaml (String)

Returns:

  • (RelatonBib::BibliographicItem)


29
30
31
# File 'lib/relaton/cen/processor.rb', line 29

def from_yaml(yaml)
  Item.from_yaml yaml
end

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

Parameters:

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

    year

  • opts (Hash)

Returns:

  • (RelatonBib::BibliographicItem)


17
18
19
# File 'lib/relaton/cen/processor.rb', line 17

def get(code, date, opts)
  Bibliography.get(code, date, opts)
end

#grammar_hashString

Returns hash of XML grammar

Returns:

  • (String)


35
36
37
# File 'lib/relaton/cen/processor.rb', line 35

def grammar_hash
  @grammar_hash ||= Cen.grammar_hash
end