Skip to content

Instantly share code, notes, and snippets.

Created July 17, 2016 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/e6859b1ff63fcdda0853098ff5b9571a to your computer and use it in GitHub Desktop.
Save anonymous/e6859b1ff63fcdda0853098ff5b9571a to your computer and use it in GitHub Desktop.
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