Sha256: 1e9eb85953c15789e789a2d0456699436180c1cbb2138c89f34a56f0039f4cad
Contents?: true
Size: 756 Bytes
Versions: 32
Compression:
Stored size: 756 Bytes
Contents
require_relative 'base_conditions_filter' module Gitlab module Triage module Filters class ForbiddenLabelsConditionsFilter < BaseConditionsFilter def validate_condition(condition) raise ArgumentError, 'condition must be an array containing forbidden label values' unless condition.is_a?(Array) end def initialize_variables(forbidden_labels) @attribute = :labels @forbidden_labels = forbidden_labels end def resource_value @resource[@attribute] end def calculate label_intersection.empty? end private def label_intersection resource_value & @forbidden_labels end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems