Sha256: f74b1a6953cdc3d2a41bf0a7f79f2845e8eb6c0a1a3ccfe00d1f624d6065a005

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

require "relaton/processor"

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

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

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonIho::IhoBibliographicItem]
    def get(code, date, opts)
      ::RelatonIho::IhoBibliography.get(code, date, opts)
    end

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

    # @param hash [Hash]
    # @return [RelatonIho::IhoBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonIho::IhoBibliographicItem.new hash
    end

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

    #
    # Remove index file
    #
    def remove_index_file
      Relaton::Index.find_or_create(:iho, url: true).remove_file
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
relaton-iho-1.19.1 lib/relaton_iho/processor.rb
relaton-iho-1.19.0 lib/relaton_iho/processor.rb
relaton-iho-1.18.0 lib/relaton_iho/processor.rb
relaton-iho-1.17.0 lib/relaton_iho/processor.rb
relaton-iho-1.16.2 lib/relaton_iho/processor.rb
relaton-iho-1.16.1 lib/relaton_iho/processor.rb
relaton-iho-1.16.0 lib/relaton_iho/processor.rb