Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enum.invert (inherited by Pair).
  • Loading branch information
jnthn committed Aug 3, 2011
1 parent 40f4264 commit e9ee086
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Enum.pm
Expand Up @@ -13,6 +13,10 @@ my class Enum {
my $method = $.key;
$topic."$method"() === $.value;
}

method invert() {
$.value => $.key;
}

method key(Enum:D:) { $!key }
method kv(Enum:D:) { $!key, $!value }
Expand Down

0 comments on commit e9ee086

Please sign in to comment.