Class: RelatonOgc::Processor
- Inherits:
-
Relaton::Processor
- Object
- Relaton::Processor
- RelatonOgc::Processor
- Defined in:
- lib/relaton_ogc/processor.rb
Instance Method Summary collapse
- #from_xml(xml) ⇒ RelatonOgc::OgcBibliographicItem
- #get(code, date = nil, opts = {}) ⇒ RelatonOgc::OgcBibliographicItem
-
#grammar_hash ⇒ String
Returns hash of XML grammar.
- #hash_to_bib(hash) ⇒ RelatonOgc::OgcBibliographicItem
-
#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_ogc/processor.rb', line 5 def initialize @short = :relaton_ogc @prefix = "OGC" @defaultprefix = %r{^OGC\s} @idtype = "OGC" end |
Instance Method Details
#from_xml(xml) ⇒ RelatonOgc::OgcBibliographicItem
22 23 24 |
# File 'lib/relaton_ogc/processor.rb', line 22 def from_xml(xml) ::RelatonOgc::XMLParser.from_xml xml end |
#get(code, date = nil, opts = {}) ⇒ RelatonOgc::OgcBibliographicItem
16 17 18 |
# File 'lib/relaton_ogc/processor.rb', line 16 def get(code, date = nil, opts = {}) ::RelatonOgc::OgcBibliography.get(code, date, opts) end |
#grammar_hash ⇒ String
Returns hash of XML grammar
35 36 37 |
# File 'lib/relaton_ogc/processor.rb', line 35 def grammar_hash @grammar_hash ||= ::RelatonOgc.grammar_hash end |
#hash_to_bib(hash) ⇒ RelatonOgc::OgcBibliographicItem
28 29 30 31 |
# File 'lib/relaton_ogc/processor.rb', line 28 def hash_to_bib(hash) item_hash = ::RelatonOgc::HashConverter.hash_to_bib(hash) ::RelatonOgc::OgcBibliographicItem.new item_hash end |