toYamlString method

String toYamlString()

Escape with '' if needed.

Implementation

String toYamlString() {
  String escape(String text) => "'$text'";
  if (_isShort()) {
    return _toShortString();
  } else if (_isSingle()) {
    return _toSingleString();
  } else if (_isEmpty()) {
    return '';
  }
  return escape(toMinMaxString());
}