enums
ErrorsCollection

enums

Synthesised documentation from type/Enumeration type/Bool

From type/Enumeration

See Original text in context

method enums()

Returns a Map of enum values. Works both on the enum type and any key.

enum Mass ( mg => 1/1000=> 1/1kg => 1000/1 );
say Mass.enums# OUTPUT: «Map.new((g => 1, kg => 1000, mg => 0.001))␤» 
say g.enums;    # OUTPUT: «Map.new((g => 1, kg => 1000, mg => 0.001))␤»

From type/Bool

See Original text in context

method enums(--> Hash:D)

Returns a Hash of enum-pairs. Works on both the Bool type and any key.

say Bool.enums;                                   # OUTPUT: «{False => 0, True => 1}␤» 
say False.enums;                                  # OUTPUT: «{False => 0, True => 1}␤»