Skip to content

Instantly share code, notes, and snippets.

@buildmotion
Created August 28, 2021 20:01
Show Gist options
  • Save buildmotion/e24c2566f228c659b347ced4643ad10f to your computer and use it in GitHub Desktop.
Save buildmotion/e24c2566f228c659b347ced4643ad10f to your computer and use it in GitHub Desktop.
import {RulePolicy} from './RulePolicy';
/**
* Use this class as a base [extends] class for simple rules. A simple contains
* a single rule and target to evaluate.
*
* If you require a rule that will contain more than one rule, you should
* use extend the [CompositeRule] class.
*/
export class SimpleRule extends RulePolicy {
/**
* The constructor for the simple rule.
* @param name: The name of the rule.
* @param message: The message to display if the rule is violated.
*/
constructor(name: string, message: string, isDisplayable: boolean) {
super(name, message, isDisplayable);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment