Completed
Push — master ( d0441d...d0185c )
by Michael
03:35
created

LoaderBase.workload()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1
# frozen_string_literal: true
2
3 1
module NoSE
4
  # Loaders which insert data into indexes from external sources
5 1
  module Loader
6
    # Superclass for all data loaders
7 1
    class LoaderBase
8 1
      def initialize(workload = nil, backend = nil)
9 1
        @workload = workload
10 1
        @backend = backend
11
      end
12
13
      # :nocov:
14
      # @abstract Subclasses should produce a workload
15
      # @return [void]
16 1
      def workload(_config)
17
        fail NotImplementedError
18
      end
19
      # :nocov:
20
21
      # :nocov:
22
      # @abstract Subclasses should load data for the given list of indexes
23
      # @return [void]
24 1
      def load(_indexes, _config, _show_progress = false, _limit = nil,
25
               _skip_existing = true)
26
        fail NotImplementedError
27
      end
28
      # :nocov:
29
30
      # @abstract Subclasses should generate a model from the external source
31
      # :nocov:
32 1
      def model(_config)
33
        fail NotImplementedError
34
      end
35
      # :nocov:
36
    end
37
  end
38
end
39