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

build_matcher.rb « matching « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dff7d9141d9db84abb33966e2ba9296a1cf431dc (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
# frozen_string_literal: true

module Gitlab
  module Ci
    module Matching
      class BuildMatcher
        ATTRIBUTES = %i[
          protected
          tag_list
          build_ids
          project
        ].freeze

        attr_reader(*ATTRIBUTES)
        alias_method :protected?, :protected

        def initialize(params)
          ATTRIBUTES.each do |attribute|
            instance_variable_set("@#{attribute}", params.fetch(attribute))
          end
        end

        def has_tags?
          tag_list.present?
        end
      end
    end
  end
end