Sha256: ce698d239c5f9ded609223f74ea3e4be635f0b53e5a9c4f1cf106debc0f8410a

Contents?: true

Size: 962 Bytes

Versions: 12

Compression:

Stored size: 962 Bytes

Contents

require "relaton/processor"

module RelatonBipm
  class Processor < Relaton::Processor
    attr_reader :idtype

    def initialize
      @short = :relaton_bipm
      @prefix = "BIPM"
      @defaultprefix = %r{^BIPM\s}
      @idtype = "BIPM"
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonBipm::BipmBibliographicItem]
    def get(code, date, opts)
      ::RelatonBipm::BipmBibliography.get(code, date, opts)
    end

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

    # @param hash [Hash]
    # @return [RelatonBipm::BipmBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonBipm::BipmBibliographicItem.from_hash hash
    end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
relaton-bipm-1.11.1 lib/relaton_bipm/processor.rb
relaton-bipm-1.11.0 lib/relaton_bipm/processor.rb
relaton-bipm-1.10.3 lib/relaton_bipm/processor.rb
relaton-bipm-1.10.2 lib/relaton_bipm/processor.rb
relaton-bipm-1.10.1 lib/relaton_bipm/processor.rb
relaton-bipm-1.10.0 lib/relaton_bipm/processor.rb
relaton-bipm-1.9.1 lib/relaton_bipm/processor.rb
relaton-bipm-1.9.0 lib/relaton_bipm/processor.rb
relaton-bipm-1.8.2 lib/relaton_bipm/processor.rb
relaton-bipm-1.8.1 lib/relaton_bipm/processor.rb
relaton-bipm-1.8.0 lib/relaton_bipm/processor.rb
relaton-bipm-1.7.2 lib/relaton_bipm/processor.rb