lib/checkoff/internal/task_selector_evaluator.rb in checkoff-0.25.0 vs lib/checkoff/internal/task_selector_evaluator.rb in checkoff-0.26.0
- old
+ new
@@ -18,10 +18,21 @@
end
attr_reader :task_selector
end
+ # :and function
+ class AndFunctionEvaluator < FunctionEvaluator
+ def matches?
+ fn?(task_selector, :and)
+ end
+
+ def evaluate(_task, lhs, rhs)
+ lhs && rhs
+ end
+ end
+
# :not function
class NotFunctionEvaluator < FunctionEvaluator
def matches?
fn?(task_selector, :not)
end
@@ -152,9 +163,10 @@
NotFunctionEvaluator,
NilPFunctionEvaluator,
TagPFunctionEvaluator,
CustomFieldValueFunctionEvaluator,
CustomFieldGidValueContainsAnyGidFunctionEvaluator,
+ AndFunctionEvaluator,
].freeze
def evaluate(task_selector)
return true if task_selector == []