Sha256: 40651ae7ca6f4454032f259470bd82ee95369e0ea3ac264a6a69ee80a4373e86

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

require "relaton/processor"

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

    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_calconnect
      @prefix = "CC"
      @defaultprefix = %r{^CC(?!\w)}
      @idtype = "CC"
      @datasets = %w[calconnect-org]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonCalconnect::CcBibliographicItem]
    def get(code, date, opts)
      ::RelatonCalconnect::CcBibliography.get(code, date, opts)
    end

    #
    # Fetch all the documents 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 [RelatonCalconnect::CcBibliographicItem]
    def from_xml(xml)
      ::RelatonCalconnect::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonIsoBib::CcBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonCalconnect::CcBibliographicItem.from_hash hash
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
relaton-calconnect-1.14.1 lib/relaton_calconnect/processor.rb
relaton-calconnect-1.14.0 lib/relaton_calconnect/processor.rb
relaton-calconnect-1.13.1 lib/relaton_calconnect/processor.rb
relaton-calconnect-1.13.0 lib/relaton_calconnect/processor.rb
relaton-calconnect-1.12.1 lib/relaton_calconnect/processor.rb
relaton-calconnect-1.12.0 lib/relaton_calconnect/processor.rb