Class: RelatonIsbn::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonIsbn::Processor
- Defined in:
- lib/relaton_isbn/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonBib::BibliographicItem
- #get(code, date, opts) ⇒ RelatonBib::BibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonBib::BibliographicItem
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
7 8 9 10 11 12 13 |
# File 'lib/relaton_isbn/processor.rb', line 7 def initialize # rubocop:disable Lint/MissingSuper @short = :relaton_isbn @prefix = "ISBN" @defaultprefix = /^ISBN\s/ @idtype = "ISBN" @datasets = %w[] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_isbn/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ RelatonBib::BibliographicItem
36 37 38 |
# File 'lib/relaton_isbn/processor.rb', line 36 def from_xml(xml) ::RelatonBib::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonBib::BibliographicItem
19 20 21 |
# File 'lib/relaton_isbn/processor.rb', line 19 def get(code, date, opts) ::RelatonIsbn::OpenLibrary.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
48 49 50 |
# File 'lib/relaton_isbn/processor.rb', line 48 def grammar_hash @grammar_hash ||= ::RelatonIsbn.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonBib::BibliographicItem
42 43 44 |
# File 'lib/relaton_isbn/processor.rb', line 42 def hash_to_bib(hash) ::RelatonBib::BibliographicItem.from_hash hash end |