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