class RelatonOgc::Processor

Public Class Methods

new() click to toggle source
# File lib/relaton_ogc/processor.rb, line 5
def initialize # rubocop:disable Lint/MissingSuper
  @short = :relaton_ogc
  @prefix = "OGC"
  @defaultprefix = %r{^OGC\s}
  @idtype = "OGC"
  @datasets = %w[ogc-naming-authority]
end

Public Instance Methods

fetch_data(_source, opts) click to toggle source

Fetch all the documents from a source

@param [String] _source source name @param [Hash] opts @option opts [String] :output directory to output documents @option opts [String] :format

# File lib/relaton_ogc/processor.rb, line 29
def fetch_data(_source, opts)
  DataFetcher.fetch(**opts)
end
from_xml(xml) click to toggle source

@param xml [String] @return [RelatonOgc::OgcBibliographicItem]

# File lib/relaton_ogc/processor.rb, line 35
def from_xml(xml)
  ::RelatonOgc::XMLParser.from_xml xml
end
get(code, date = nil, opts = {}) click to toggle source

@param code [String] @param date [String, NilClass] year @param opts [Hash] @return [RelatonOgc::OgcBibliographicItem]

# File lib/relaton_ogc/processor.rb, line 17
def get(code, date = nil, opts = {})
  ::RelatonOgc::OgcBibliography.get(code, date, opts)
end
grammar_hash() click to toggle source

Returns hash of XML grammar @return [String]

# File lib/relaton_ogc/processor.rb, line 47
def grammar_hash
  @grammar_hash ||= ::RelatonOgc.grammar_hash
end
hash_to_bib(hash) click to toggle source

@param hash [Hash] @return [RelatonOgc::OgcBibliographicItem]

# File lib/relaton_ogc/processor.rb, line 41
def hash_to_bib(hash)
  ::RelatonOgc::OgcBibliographicItem.from_hash hash
end