toYaml method

String toYaml()

Converts this object to a YAML string.

Uses yamlBuilder to serialize the result of toJson(). Throws an UnimplementedError if yamlBuilder is not provided.

Implementation

String toYaml() {
  if (yamlBuilder == null) throw UnimplementedError();
  return yamlBuilder!(toJson());
}