Class: RelatonIso::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonIso::Processor
- Defined in:
- lib/relaton_iso/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonIsoBib::IsoBibliographicItem
- #get(code, date, opts) ⇒ RelatonIsoBib::IsoBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonIsoBib::IsoBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
-
#threads ⇒ Integer
Returns number of workers.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 |
# File 'lib/relaton_iso/processor.rb', line 7 def initialize @short = :relaton_iso @prefix = "ISO" @defaultprefix = %r{^ISO(/IEC)?\s} @idtype = "ISO" end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_iso/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ RelatonIsoBib::IsoBibliographicItem
24 25 26 |
# File 'lib/relaton_iso/processor.rb', line 24 def from_xml(xml) ::RelatonIsoBib::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonIsoBib::IsoBibliographicItem
18 19 20 |
# File 'lib/relaton_iso/processor.rb', line 18 def get(code, date, opts) ::RelatonIso::IsoBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
37 38 39 |
# File 'lib/relaton_iso/processor.rb', line 37 def grammar_hash @grammar_hash ||= ::RelatonIsoBib.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonIsoBib::IsoBibliographicItem
30 31 32 33 |
# File 'lib/relaton_iso/processor.rb', line 30 def hash_to_bib(hash) item_hash = ::RelatonIsoBib::HashConverter.hash_to_bib(hash) ::RelatonIsoBib::IsoBibliographicItem.new(**item_hash) end |
#threads ⇒ Integer
Returns number of workers
43 44 45 |
# File 'lib/relaton_iso/processor.rb', line 43 def threads 3 end |