lib/checkoff/internal/selector_classes/common.rb in checkoff-0.182.0 vs lib/checkoff/internal/selector_classes/common.rb in checkoff-0.183.0
- old
+ new
@@ -209,9 +209,30 @@
actual_custom_field_values_gids.include?(custom_field_value)
end
end
end
+ # :name_starts_with? function
+ class NameStartsWithPFunctionEvaluator < FunctionEvaluator
+ FUNCTION_NAME = :name_starts_with?
+
+ def matches?
+ fn?(selector, FUNCTION_NAME)
+ end
+
+ def evaluate_arg?(_index)
+ false
+ end
+
+ # @param resource [Asana::Resources::Task,Asana::Resources::Project]
+ # @param prefix [String]
+ # @return [Boolean]
+ # @sg-ignore
+ def evaluate(resource, prefix)
+ resource.name.start_with?(prefix)
+ end
+ end
+
# String literals
class StringLiteralEvaluator < FunctionEvaluator
def matches?
selector.is_a?(String)
end