2023-12-06 17:11:32 +01:00
|
|
|
class Logic::InRegionOperator < Logic::BinaryOperator
|
|
|
|
def operation
|
|
|
|
:est_dans_la_region
|
|
|
|
end
|
|
|
|
|
|
|
|
def compute(champs)
|
2024-02-13 11:24:58 +01:00
|
|
|
l = @left.compute(champs)
|
2023-12-06 17:11:32 +01:00
|
|
|
r = @right.compute(champs)
|
|
|
|
|
|
|
|
return false if l.nil?
|
|
|
|
|
2024-02-13 11:24:58 +01:00
|
|
|
l.fetch(:code_region) == r
|
2023-12-06 17:11:32 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def errors(type_de_champs = [])
|
|
|
|
@left.errors(type_de_champs) + @right.errors(type_de_champs)
|
|
|
|
end
|
|
|
|
end
|