toJSON

convert an enum name to a JSONValue

Examples

Enums are serialized by name.

enum Category { one, two }

assert(Category.one.toJSON.str == "one");
assert(Category.two.toJSON.str == "two");

Meta