Class: RelatonIec::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonIec::Processor
- Defined in:
- lib/relaton_iec/processor.rb
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonIsoBib::IecBibliographicItem
- #get(code, date, opts) ⇒ RelatonIsoBib::IecBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonIsoBib::IecBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
5 6 7 8 9 10 |
# File 'lib/relaton_iec/processor.rb', line 5 def initialize @short = :relaton_iec @prefix = "IEC" @defaultprefix = %r{^IEC\s|^IEV($|\s)} @idtype = "IEC" end |
Instance Method Details
#from_xml(xml) ⇒ RelatonIsoBib::IecBibliographicItem
22 23 24 |
# File 'lib/relaton_iec/processor.rb', line 22 def from_xml(xml) RelatonIec::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonIsoBib::IecBibliographicItem
16 17 18 |
# File 'lib/relaton_iec/processor.rb', line 16 def get(code, date, opts) ::RelatonIec::IecBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
35 36 37 |
# File 'lib/relaton_iec/processor.rb', line 35 def grammar_hash @grammar_hash ||= ::RelatonIec.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonIsoBib::IecBibliographicItem
28 29 30 31 |
# File 'lib/relaton_iec/processor.rb', line 28 def hash_to_bib(hash) item_hash = ::RelatonIec::HashConverter.hash_to_bib(hash) ::RelatonIec::IecBibliographicItem.new item_hash end |