Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add some basic Enum documentation
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| =begin pod | ||
| =head1 Enum | ||
| class Enum does Associative { ... } | ||
| An C<Enum> consists of a key and a value. It is the immutable version of | ||
| C<Pair> (which inherits from Enum). | ||
| =head2 Methods | ||
| =head3 key | ||
| multi method key(Enum:D:) | ||
| Returns the key part of the Enum | ||
| =head3 value | ||
| multi method value(Enum:D:) | ||
| Returns the value part of the Enum | ||
| =head3 invert | ||
| multi method invert(Enum:D:) returns Enum:D | ||
| Returns a new C<Enum> with the original enum's value as the key, and the | ||
| original enum's key as value. | ||
| =end pod |