diff options
Diffstat (limited to 'lib/Bot/Games/Trait/Method/Command.pm')
-rw-r--r-- | lib/Bot/Games/Trait/Method/Command.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Bot/Games/Trait/Method/Command.pm b/lib/Bot/Games/Trait/Method/Command.pm new file mode 100644 index 0000000..e00cb43 --- /dev/null +++ b/lib/Bot/Games/Trait/Method/Command.pm @@ -0,0 +1,24 @@ +package Bot::Games::Trait::Method::Command; +use Moose::Role; + +has pass_args => ( + is => 'rw', + isa => 'Bool', + default => 1, +); + +has needs_init => ( + is => 'rw', + isa => 'Bool', + default => 1, +); + +around execute => sub { + my $orig = shift; + my $self = shift; + return $self->pass_args ? $self->$orig(@_) : $self->$orig($_[0]); +}; + +no Moose::Role; + +1; |