Class: Relaton::Bsi::Processor

Inherits:
Core::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) ⇒ Relaton::Bsi::ItemData

Parameters:

  • xml (String)

Returns:



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

def from_xml(xml)
  require_relative "../bsi"
  ::Relaton::Bsi::Item.from_xml xml
end

#from_yaml(yaml) ⇒ Relaton::Bsi::ItemData

Parameters:

  • hash (Hash)

Returns:



30
31
32
33
# File 'lib/relaton/bsi/processor.rb', line 30

def from_yaml(yaml)
  require_relative "../bsi"
  ::Relaton::Bsi::Item.from_yaml yaml
end

#get(code, date, opts) ⇒ Relaton::Bsi::ItemData

Parameters:

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

    year

  • opts (Hash)

Returns:



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

def get(code, date, opts)
  require_relative "../bsi"
  ::Relaton::Bsi::Bibliography.get(code, date, opts)
end

#grammar_hashString

Returns hash of XML grammar

Returns:

  • (String)


37
38
39
40
# File 'lib/relaton/bsi/processor.rb', line 37

def grammar_hash
  require_relative "../bsi"
  @grammar_hash ||= ::Relaton::Bsi.grammar_hash
end