Class: Relaton::Isbn::Processor
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- Relaton::Isbn::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) ⇒ Relaton::Bib::Bibitem
- #from_yaml(hash) ⇒ Relaton::Bib::Bibitem
- #get(code, date, opts) ⇒ Relaton::Bib::Bibitem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
-
#initialize ⇒ Processor
constructor
rubocop:disable Lint/MissingSuper.
Constructor Details
#initialize ⇒ Processor
rubocop:disable Lint/MissingSuper
8 9 10 11 12 13 14 |
# File 'lib/relaton/isbn/processor.rb', line 8 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.
6 7 8 |
# File 'lib/relaton/isbn/processor.rb', line 6 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ Relaton::Bib::Bibitem
28 29 30 31 |
# File 'lib/relaton/isbn/processor.rb', line 28 def from_xml(xml) require_relative "../isbn" ::Relaton::Bib::Bibitem.from_xml xml end |
#from_yaml(hash) ⇒ Relaton::Bib::Bibitem
35 36 37 38 |
# File 'lib/relaton/isbn/processor.rb', line 35 def from_yaml(hash) require_relative "../isbn" ::Relaton::Bib::Bibitem.from_hash hash end |
#get(code, date, opts) ⇒ Relaton::Bib::Bibitem
20 21 22 23 |
# File 'lib/relaton/isbn/processor.rb', line 20 def get(code, date, opts) require_relative "../isbn" ::Relaton::Isbn::OpenLibrary.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
42 43 44 45 |
# File 'lib/relaton/isbn/processor.rb', line 42 def grammar_hash require_relative "../isbn" @grammar_hash ||= ::Relaton::Isbn.grammar_hash end |