Created
July 17, 2016 18:51
-
-
Save anonymous/e6859b1ff63fcdda0853098ff5b9571a 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