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