Class: Gitlab::Triage::Filters::BranchProtectedFilter

Inherits:
BaseConditionsFilter show all
Defined in:
lib/gitlab/triage/filters/branch_protected_filter.rb

Instance Method Summary collapse

Methods inherited from BaseConditionsFilter

all_params_filter_names, filter_parameters, #initialize, params_check_for_field, params_checking_condition_type, params_checking_condition_value, params_filter_names, #validate_condition

Constructor Details

This class inherits a constructor from Gitlab::Triage::Filters::BaseConditionsFilter

Instance Method Details

#calculateObject



20
21
22
# File 'lib/gitlab/triage/filters/branch_protected_filter.rb', line 20

def calculate
  resource_value == condition_value
end

#condition_valueObject



16
17
18
# File 'lib/gitlab/triage/filters/branch_protected_filter.rb', line 16

def condition_value
  @condition
end

#initialize_variables(config_value) ⇒ Object



7
8
9
10
# File 'lib/gitlab/triage/filters/branch_protected_filter.rb', line 7

def initialize_variables(config_value)
  @attribute = :protected
  @condition = config_value.nil? ? true : config_value
end

#resource_valueObject



12
13
14
# File 'lib/gitlab/triage/filters/branch_protected_filter.rb', line 12

def resource_value
  @resource[:protected]
end