Sha256: b6a6405318d67578e39cd051bb81d7f10b7975e8c14be27173a235f396fba274

Contents?: true

Size: 1016 Bytes

Versions: 9

Compression:

Stored size: 1016 Bytes

Contents

require "relaton/processor"
require "relaton_omg/xml_parser"

module RelatonOmg
  class Processor < Relaton::Processor
    def initialize
      @short = :relaton_omg
      @prefix = "OMG"
      @defaultprefix = /^OMG /
      @idtype = "OMG"
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonOmg::OmgBibliographicItem]
    def get(code, date, opts)
      ::RelatonOmg::OmgBibliography.get(code, date, opts)
    end

    # @param xml [String]
    # @return [RelatonOmg::OmgBibliographicItem]
    def from_xml(xml)
      ::RelatonOmg::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonOmg::OmgBibliographicItem]
    def hash_to_bib(hash)
      # item_hash = ::RelatonOmg::HashConverter.hash_to_bib(hash)
      ::RelatonOmg::OmgBibliographicItem.from_hash hash
    end

    # Returns hash of XML grammar
    # @return [String]
    def grammar_hash
      @grammar_hash ||= ::RelatonOmg.grammar_hash
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
relaton-omg-1.20.0 lib/relaton_omg/processor.rb
relaton-omg-1.19.1 lib/relaton_omg/processor.rb
relaton-omg-1.19.0 lib/relaton_omg/processor.rb
relaton-omg-1.18.1 lib/relaton_omg/processor.rb
relaton-omg-1.18.0 lib/relaton_omg/processor.rb
relaton-omg-1.17.0 lib/relaton_omg/processor.rb
relaton-omg-1.16.2 lib/relaton_omg/processor.rb
relaton-omg-1.16.1 lib/relaton_omg/processor.rb
relaton-omg-1.16.0 lib/relaton_omg/processor.rb