Sha256: ca4ecbd7cd54d7bce025c5896ba038465a1e5cc98147771125d0844c87c09bf2

Contents?: true

Size: 1.42 KB

Versions: 10

Compression:

Stored size: 1.42 KB

Contents

require "relaton/processor"

module RelatonCie
  class Processor < Relaton::Processor
    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_cie
      @prefix = "CIE"
      @defaultprefix = /^CIE(-|\s)/
      @idtype = "CIE"
      @datasets = %w[cie-techstreet]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonCie::BibliographicItem]
    def get(code, date, opts)
      ::RelatonCie::CieBibliography.get(code, date, opts)
    end

    #
    # Fetch all the docukents from a source
    #
    # @param [String] _source source name
    # @param [Hash] opts
    # @option opts [String] :output directory to output documents
    # @option opts [String] :format
    #
    def fetch_data(_source, opts)
      DataFetcher.fetch(**opts)
    end

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

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

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
relaton-cie-1.20.0 lib/relaton_cie/processor.rb
relaton-cie-1.19.1 lib/relaton_cie/processor.rb
relaton-cie-1.19.0 lib/relaton_cie/processor.rb
relaton-cie-1.18.1 lib/relaton_cie/processor.rb
relaton-cie-1.18.0 lib/relaton_cie/processor.rb
relaton-cie-1.17.0 lib/relaton_cie/processor.rb
relaton-cie-1.16.2 lib/relaton_cie/processor.rb
relaton-cie-1.16.1 lib/relaton_cie/processor.rb
relaton-cie-1.16.0 lib/relaton_cie/processor.rb
relaton-cie-1.14.1 lib/relaton_cie/processor.rb