Sha256: fb9ef40eec3460fc961aa705fc2ad21c03acb9d42df8c94e2c547fc0939b53ec

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

require "relaton/processor"

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

    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_ieee
      @prefix = "IEEE"
      @defaultprefix = %r{^IEEE\s}
      @idtype = "IEEE"
      @datasets = %w[ieee-rawbib]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonIeee::IeeeBibliographicItem]
    def get(code, date, opts)
      ::RelatonIeee::IeeeBibliography.get(code, date, opts)
    end

    #
    # Fetch all the documents from ./iee-rawbib directory
    #
    # @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 [RelatonIeee::IeeeBibliographicItem]
    def from_xml(xml)
      ::RelatonIeee::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonIeee::IeeeBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonIeee::IeeeBibliographicItem.new(**hash)
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
relaton-ieee-1.14.2 lib/relaton_ieee/processor.rb
relaton-ieee-1.14.1 lib/relaton_ieee/processor.rb
relaton-ieee-1.14.0 lib/relaton_ieee/processor.rb
relaton-ieee-1.13.1 lib/relaton_ieee/processor.rb
relaton-ieee-1.13.0 lib/relaton_ieee/processor.rb
relaton-ieee-1.12.8 lib/relaton_ieee/processor.rb