Class: Gitlab::Triage::Filters::NoAdditionalLabelsConditionsFilter
Class Method Summary
collapse
Instance Method Summary
collapse
all_params_filter_names, #initialize, params_check_for_field, params_checking_condition_type, params_checking_condition_value, params_filter_names
Class Method Details
.filter_parameters ⇒ Object
9
10
11
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 9
def self.filter_parameters
[]
end
|
Instance Method Details
#calculate ⇒ Object
26
27
28
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 26
def calculate
(resource_value - @expected_labels).empty?
end
|
#initialize_variables(expected_labels) ⇒ Object
17
18
19
20
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 17
def initialize_variables(expected_labels)
@attribute = :labels
@expected_labels = expected_labels
end
|
#resource_value ⇒ Object
22
23
24
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 22
def resource_value
@resource[@attribute]
end
|
#validate_condition(condition) ⇒ Object
13
14
15
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 13
def validate_condition(condition)
raise ArgumentError, 'condition must be an array containing the only label values allowed' unless condition.is_a?(Array)
end
|