ruleFor method

RuleBuilder ruleFor (String key, Function func)

Create a container to hold rules for a property. The value of the property should be returned by the passed in Function

Implementation

RuleBuilder ruleFor(String key, Function func) {
  var container = new RuleContainer(func);
  _rules.putIfAbsent(key, () {
    return container;
  });
  return new RuleBuilder(key, container);
}