allPass
Create a function that combines all predicates with 'and'.
Func f = (Func)R.allPass.run(
R.startsWith.apply('c'),
R.endsWith.apply('t')
);
system.debug(f.run('cat'));
// true
Create a function that combines all predicates with 'and'.
Func f = (Func)R.allPass.run(
R.startsWith.apply('c'),
R.endsWith.apply('t')
);
system.debug(f.run('cat'));
// true
Create a function that combines all predicates with 'or'.
Func f = (Func)R.anyPass.run(
R.startsWith.apply('c'),
R.endsWith.apply('t')
);
system.debug(f.run('cc'));
// true
Create a function that negate the predicate.
Func f = (Func)R.complement.run(R.equals.apply('cat'));
system.debug(f.run('cat'));
// false
Test logic 'and'.
R.doAnd.run(true, false)
// false
Test logic 'not'.
R.doNot.run(false)
// true
Test logic 'or'.
R.doOr.run(true, false)
// true
Contribute on Github! Edit this section.