Class: Krikri::PrimoParser

Inherits:
XmlParser show all
Defined in:
lib/krikri/parsers/primo_parser.rb

Overview

A Primo parser. Uses XML parser with a root path to match the metadata path.

See Also:

Constant Summary collapse

DEFAULT_NAMESPACE =
'nmbib'

Instance Attribute Summary

Attributes inherited from Parser

#record, #root

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#local_name, parse

Constructor Details

#initialize(record, root_path = '//sear:DOC', ns = {nmbib: 'http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib'}) ⇒ PrimoParser

Returns a new instance of PrimoParser.



21
22
23
24
25
# File 'lib/krikri/parsers/primo_parser.rb', line 21

def initialize(record,
               root_path = '//sear:DOC',
               ns = {nmbib: 'http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib'})
  super(record, root_path, ns)
end

Class Method Details

.display(*args) ⇒ Object



13
14
15
# File 'lib/krikri/parsers/primo_parser.rb', line 13

def self.display(*args)
  record('display', *args)
end

.record(*args) ⇒ Object



9
10
11
# File 'lib/krikri/parsers/primo_parser.rb', line 9

def self.record(*args)
  ['PrimoNMBib', 'record', *args].map { |s| "#{DEFAULT_NAMESPACE}:#{s}" }
end

.search(*args) ⇒ Object



17
18
19
# File 'lib/krikri/parsers/primo_parser.rb', line 17

def self.search(*args)
  record('search', *args)
end