Sha256: d5173592356c5051cc347a74d04cf0ad1d3ead72a72b939f22ea4a3b1f0627e6

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

require "relaton/processor"

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

    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_ccsds
      @prefix = "CCSDS"
      @defaultprefix = %r{^CCSDS(?!\w)}
      @idtype = "CCSDS"
      @datasets = %w[ccsds]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonCcsds::BibliographicItem]
    def get(code, date, opts)
      ::RelatonCcsds::Bibliography.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 [RelatonCcsds::CcBibliographicItem]
    def from_xml(xml)
      ::RelatonCcsds::XMLParser.from_xml xml
    end

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

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
relaton-ccsds-1.20.1 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.20.0 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.19.0 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.18.1 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.18.0 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.17.0 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.16.3 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.16.2 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.16.1 lib/relaton_ccsds/processor.rb
relaton-ccsds-1.16.0 lib/relaton_ccsds/processor.rb