macrame.enums
This trait provides conversion from an enumeration to String. It works by extending the companion object of the enumeration class.
@enum class Color { Red Blue Yellow } object Color extends AsString[Color]
This enables the following two ways to convert Color to a String.
Color
String
Red.asString Color.asString(Red) // returns "Red"
This trait provides conversion from an enumeration to String. It works by extending the companion object of the enumeration class.
This enables the following two ways to convert
Color
to aString
.Red.asString Color.asString(Red) // returns "Red"