Class: RelatonBsi::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



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

def initialize
  @short = :relaton_bsi
  @prefix = "BSI"
  @defaultprefix = %r{^(BSI|BS|PD)\s}
  @idtype = "BSI"
end

Instance Method Details

#from_xml(xml) ⇒ RelatonBsi::BsiBibliographicItem

Parameters:

  • xml (String)

Returns:



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

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

#get(code, date, opts) ⇒ RelatonBsi::BsiBibliographicItem

Parameters:

  • code (String)
  • date (String, nil)

    year

  • opts (Hash)

Returns:



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

def get(code, date, opts)
  ::RelatonBsi::BsiBibliography.get(code, date, opts)
end

#grammar_hashString

Returns hash of XML grammar

Returns:

  • (String)


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

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

#hash_to_bib(hash) ⇒ RelatonBsi::BsiBibliographicItem

Parameters:

  • hash (Hash)

Returns:



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

def hash_to_bib(hash)
  ::RelatonBsi::BsiBibliographicItem.from_hash hash
end