EnumClass

EnumClass

EnumClass is the base class used to create hierarchical enums. The only example in Spitsh of this is the OS EnumClass which stores the relationships between Operating Systems.

ACCEPTS

method ACCEPTS(EnumClass $b āŸ¶ Bool)

Returns True if the argument EnumClass is a member of the invocant EnumClass.

has-member

method has-member(Str $candidate āŸ¶ Bool)

Returns true if the argument string exactly matches a member of the enum class.

say Debian.has-member('Ubuntu'); # true
say RHEL.has-member('Ubuntu'); # false
say Ubuntu ~~ Debian; # true
ParameterDescription
$candidateA string to match against the enum's members

name

method name( āŸ¶ Str)

Returns the name of the enum class.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.