summaryrefslogtreecommitdiffstats
path: root/lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm
blob: 670fef1e7e47ae8e8a955f8bd29de9f012af1fa4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package IM::Engine::Plugin::Commands::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;