call method

  1. @override
bool call(
  1. Object? object, {
  2. C? cell,
  3. dynamic arguments,
  4. bool exception(
    1. TestRule<dynamic, Cell> rule,
    2. Exception e
    ) = TestRuleTrue.passed,
})

Validates the given object against this rule.

Throws an ArgumentError if the object is not a Cell. Returns the result of applying the rule's validation function to the cell link.

Parameters:

  • object: The object to validate (must be a Cell)
  • cell: Optional Cell context for the validation (typically the host cell)
  • arguments: Not used in this implementation
  • exception: Exception handler callback

Implementation

@override
bool call(Object? object, {C? cell, arguments, bool Function(TestRule rule, Exception e) exception = TestRuleTrue.passed}) {
  try {
    if (object is! Cell) {
      throw ArgumentError.value(object, 'object', 'object not Cell');
    }
    return link(object, cell: cell);
  } on Exception catch(e) {
    return exception(this, e);
  }
}