Class: RelatonIho::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonIho::Processor
- Defined in:
- lib/relaton_iho/processor.rb
Instance Attribute Summary collapse
-
#idtype ⇒ Object
readonly
Returns the value of attribute idtype.
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonIho::IhoBibliographicItem
- #get(code, date, opts) ⇒ RelatonIho::IhoBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonIho::IhoBibliographicItem
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
-
#remove_index_file ⇒ Object
Remove index file.
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 |
# File 'lib/relaton_iho/processor.rb', line 7 def initialize @short = :relaton_iho @prefix = "IHO" @defaultprefix = %r{^IHO\s} @idtype = "IHO" end |
Instance Attribute Details
#idtype ⇒ Object (readonly)
Returns the value of attribute idtype.
5 6 7 |
# File 'lib/relaton_iho/processor.rb', line 5 def idtype @idtype end |
Instance Method Details
#from_xml(xml) ⇒ RelatonIho::IhoBibliographicItem
24 25 26 |
# File 'lib/relaton_iho/processor.rb', line 24 def from_xml(xml) ::RelatonIho::XMLParser.from_xml xml end |
#get(code, date, opts) ⇒ RelatonIho::IhoBibliographicItem
18 19 20 |
# File 'lib/relaton_iho/processor.rb', line 18 def get(code, date, opts) ::RelatonIho::IhoBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
36 37 38 |
# File 'lib/relaton_iho/processor.rb', line 36 def grammar_hash @grammar_hash ||= ::RelatonIho.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonIho::IhoBibliographicItem
30 31 32 |
# File 'lib/relaton_iho/processor.rb', line 30 def hash_to_bib(hash) ::RelatonIho::IhoBibliographicItem.new hash end |
#remove_index_file ⇒ Object
Remove index file
43 44 45 |
# File 'lib/relaton_iho/processor.rb', line 43 def remove_index_file Relaton::Index.find_or_create(:iho, url: true).remove_file end |