Class: Gitlab::Triage::Filters::RubyConditionsFilter
Class Method Summary
collapse
Instance Method Summary
collapse
all_params_filter_names, filter_parameters, params_check_for_field, params_checking_condition_type, params_checking_condition_value, params_filter_names, #validate_condition
Constructor Details
#initialize(resource, condition, network = nil) ⇒ RubyConditionsFilter
Returns a new instance of RubyConditionsFilter.
13
14
15
16
17
|
# File 'lib/gitlab/triage/filters/ruby_conditions_filter.rb', line 13
def initialize(resource, condition, network = nil)
super(resource, condition)
@network = network
end
|
Class Method Details
.limiter_parameters ⇒ Object
9
10
11
|
# File 'lib/gitlab/triage/filters/ruby_conditions_filter.rb', line 9
def self.limiter_parameters
[{ name: :ruby, type: String }]
end
|
Instance Method Details
#calculate ⇒ Object
19
20
21
22
23
|
# File 'lib/gitlab/triage/filters/ruby_conditions_filter.rb', line 19
def calculate
context = Resource::Context.build(@resource, network: @network, redact_confidentials: false)
!!context.eval(@expression)
end
|
#initialize_variables(condition) ⇒ Object
27
28
29
|
# File 'lib/gitlab/triage/filters/ruby_conditions_filter.rb', line 27
def initialize_variables(condition)
@expression = condition[:ruby]
end
|