Sha256: c8ef152430bce2a780c5fcf4b779e6aff7a948164a1761efa23d40da0d1b1a7c

Contents?: true

Size: 1022 Bytes

Versions: 30

Compression:

Stored size: 1022 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 [RelatonIetf::IetfBibliographicItem]
    def get(code, date, opts)
      ::RelatonOmg::OmgBibliography.get(code, date, opts)
    end

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

    # @param hash [Hash]
    # @return [RelatonIetf::IetfBibliographicItem]
    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

30 entries across 30 versions & 2 rubygems

Version Path
relaton-omg-1.14.0 lib/relaton_omg/processor.rb
relaton-omg-1.13.0 lib/relaton_omg/processor.rb
relaton-omg-1.12.0 lib/relaton_omg/processor.rb
relaton-omg-1.11.2 lib/relaton_omg/processor.rb
relaton-omg-1.11.1 lib/relaton_omg/processor.rb
relaton-omg-1.11.0 lib/relaton_omg/processor.rb
relaton-omg-1.10.1 lib/relaton_omg/processor.rb
relaton-omg-1.10.0 lib/relaton_omg/processor.rb
relaton-omg-1.9.0 lib/relaton_omg/processor.rb
relaton-omg-1.8.0 lib/relaton_omg/processor.rb
relaton-omg-1.7.3 lib/relaton_omg/processor.rb
relaton-omg-1.7.2 lib/relaton_omg/processor.rb
relaton-omg-1.7.1 lib/relaton_omg/processor.rb
relaton-omg-1.7.0 lib/relaton_omg/processor.rb
relaton-omg-1.6.0 lib/relaton_omg/processor.rb
relaton-omg-1.6.pre1 lib/relaton_omg/processor.rb
relaton-omg-1.5.0 lib/relaton_omg/processor.rb
relaton-omg-1.5.pre lib/relaton_omg/processor.rb
relaton-omg-1.4.0 lib/relaton_omg/processor.rb
relaton-omg-1.3.0 lib/relaton_omg/processor.rb