Class: RelatonDoi::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonDoi::Processor
- Defined in:
- lib/relaton_doi/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonBipm::BipmBibliographicItem
- #get(code, _date, _opts) ⇒ RelatonBib::BibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonBipm::BipmBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
-
#threads ⇒ Integer
Returns number of threads.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 13 |
# File 'lib/relaton_doi/processor.rb', line 7 def initialize @short = :relaton_doi @prefix = "DOI" @defaultprefix = %r{^doi:} @idtype = "DOI" # @datasets = %w[bipm-data-outcomes bipm-si-brochure] end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_doi/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ RelatonBipm::BipmBibliographicItem
35 36 37 |
# File 'lib/relaton_doi/processor.rb', line 35 def from_xml(xml) ::RelatonBib::XMLParser.from_xml xml end |
#get(code, _date, _opts) ⇒ RelatonBib::BibliographicItem
19 20 21 |
# File 'lib/relaton_doi/processor.rb', line 19 def get(code, _date, _opts) Crossref.get(code) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
47 48 49 |
# File 'lib/relaton_doi/processor.rb', line 47 def grammar_hash @grammar_hash ||= ::RelatonDoi.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonBipm::BipmBibliographicItem
41 42 43 |
# File 'lib/relaton_doi/processor.rb', line 41 def hash_to_bib(hash) ::RelatonBib::BibliographicItem.from_hash hash end |
#threads ⇒ Integer
Returns number of threads
53 54 55 |
# File 'lib/relaton_doi/processor.rb', line 53 def threads 2 end |