RuleConfig.fromYaml constructor

RuleConfig.fromYaml(
  1. String yamlContent
)

Parses configuration from YAML content.

Implementation

factory RuleConfig.fromYaml(String yamlContent) {
  final yaml = loadYaml(yamlContent);
  if (yaml is! Map) {
    return RuleConfig.defaults();
  }

  return RuleConfig.fromMap(Map<String, dynamic>.from(yaml));
}