or method

Spec<T> or(
  1. Spec<T> other
)

Combines this spec with another using OR logic.

Returns a new spec that is satisfied when at least one of this spec or other is satisfied. Use this when any of multiple conditions being true is acceptable. Equivalent to using the | operator.

Example:

// At least one must be true
final canAccess = IsAdmin().or(IsModerator()).or(IsOwner());
final specialUser = IsBeta() | IsStaff() | IsVip();

Implementation

Spec<T> or(Spec<T> other) => _Or(this, other);