7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/decouplio/steps/shared/fail_resolver.rb', line 7
def self.call(instance:, result:, on_success_type:, on_failure_type:)
if result
case on_success_type
when Decouplio::Const::Results::STEP_PASS, Decouplio::Const::Results::PASS
instance.pass_action
Decouplio::Const::Results::PASS
when Decouplio::Const::Results::STEP_FAIL, Decouplio::Const::Results::FAIL
instance.fail_action
Decouplio::Const::Results::PASS
when Decouplio::Const::Results::FINISH_HIM
instance.fail_action
Decouplio::Const::Results::FINISH_HIM
end
elsif [
Decouplio::Const::Results::STEP_PASS,
Decouplio::Const::Results::PASS
].include?(on_failure_type)
instance.pass_action
Decouplio::Const::Results::FAIL
elsif [
Decouplio::Const::Results::STEP_FAIL,
Decouplio::Const::Results::FAIL
].include?(on_failure_type)
instance.fail_action
Decouplio::Const::Results::FAIL
elsif on_failure_type == Decouplio::Const::Results::FINISH_HIM
instance.fail_action
Decouplio::Const::Results::FINISH_HIM
end
end
|