Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base.rb « mapper « external « config « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2f56d0b8f6e3fbfd3478fdb8967c03a81384582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

module Gitlab
  module Ci
    class Config
      module External
        class Mapper
          # Base class for mapper classes
          class Base
            def initialize(context)
              @context = context
            end

            def process(*args)
              context.logger.instrument(mapper_instrumentation_key) do
                process_without_instrumentation(*args)
              end
            end

            private

            attr_reader :context

            def process_without_instrumentation
              raise NotImplementedError
            end

            def mapper_instrumentation_key
              "config_mapper_#{self.class.name.demodulize.downcase}".to_sym
            end
          end
        end
      end
    end
  end
end