2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-12-08 14:03:06 +01:00
|
|
|
class Logic::NotInDepartementOperator < Logic::InDepartementOperator
|
|
|
|
def operation
|
|
|
|
:n_est_pas_dans_le_departement
|
|
|
|
end
|
|
|
|
|
|
|
|
def compute(champs = [])
|
2024-02-13 11:24:58 +01:00
|
|
|
l = @left.compute(champs)
|
2023-12-08 14:03:06 +01:00
|
|
|
r = @right.compute(champs)
|
|
|
|
|
|
|
|
return false if l.nil?
|
|
|
|
|
2024-02-13 11:24:58 +01:00
|
|
|
l.fetch(:code_departement) != r
|
2023-12-08 14:03:06 +01:00
|
|
|
end
|
|
|
|
end
|