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
7
8
9
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 7
def self.filter_parameters
[]
end
|
Instance Method Details
#calculate ⇒ Object
24
25
26
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 24
def calculate
(resource_value - @expected_labels).empty?
end
|
#initialize_variables(expected_labels) ⇒ Object
15
16
17
18
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 15
def initialize_variables(expected_labels)
@attribute = :labels
@expected_labels = expected_labels
end
|
#resource_value ⇒ Object
20
21
22
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 20
def resource_value
@resource[@attribute]
end
|
#validate_condition(condition) ⇒ Object
11
12
13
|
# File 'lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb', line 11
def validate_condition(condition)
raise ArgumentError, 'condition must be an array containing the only label values allowed' unless condition.is_a?(Array)
end
|