Toon
Constants
BACKSLASH = '\\'
Escape characters
CARRIAGE_RETURN = '\r'
CLOSE_BRACE = '}'
CLOSE_BRACKET = ']'
COLON = ':'
COMMA = ','
Structural characters
DEFAULT_DELIMITER = COMMA
DOUBLE_QUOTE = '"'
FALSE_LITERAL = "false"
LIST_ITEM_MARKER = '-'
List markers
LIST_ITEM_PREFIX = "- "
NEWLINE = '\n'
NULL_LITERAL = "null"
Literals
OPEN_BRACE = '{'
OPEN_BRACKET = '['
Brackets and braces
PIPE = '|'
SPACE = ' '
TAB = '\t'
TRUE_LITERAL = "true"
VERSION = {{ (`shards version /tmp/tmp.oCFGEn/src/src/toon`).chomp.stringify }}
Instance methods
decode(input : String, indent : Int32 = 2, strict : Bool = true)
Decode TOON-formatted string to a Crystal value
@param input : TOON-formatted string @param indent : Number of spaces per indentation level (default: 2) @param strict : Enable strict validations (indentation, no tabs, no blank lines inside arrays, exact counts) (default: true) @return : Decoded Crystal value
encode(input, indent : Int32 = 2, delimiter : String | Char = DEFAULT_DELIMITER)
Encode any value to TOON format
@param input : Any value to encode @param indent : Number of spaces per indentation level (default: 2) @param delimiter : Delimiter for array values and tabular rows (default: ',') @return : TOON-formatted string