-
-
Save gfldex/12144bca4252447290332aff0f078ae0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Command { | |
has Str $.name; | |
method ACCEPTS(Any:D $other) { | |
return $other ~~ Str and $other ~~ $!name; | |
} | |
} | |
my $c = Command.new(name => 'foo'); | |
say ('foo' ~~ $c); #outputs: True | |
say ('bar' ~~ $c); #outputs: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment