diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-08-24 00:44:17 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-08-24 02:29:40 -0500 |
commit | d23fc07e2c69e1c3a200092613e40b5e90f73f81 (patch) | |
tree | b6d4a38cf17b1b40e286fc94c189eda2d5e22c39 /lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm | |
parent | cad0cd7a59ac086fe2ba6264440a517cd34bf223 (diff) | |
download | im-engine-plugin-commands-d23fc07e2c69e1c3a200092613e40b5e90f73f81.tar.gz im-engine-plugin-commands-d23fc07e2c69e1c3a200092613e40b5e90f73f81.zip |
port over the basic structure from Bot::Games
Diffstat (limited to 'lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm')
-rw-r--r-- | lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm b/lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm new file mode 100644 index 0000000..670fef1 --- /dev/null +++ b/lib/IM/Engine/Plugin/Commands/Trait/Method/Command.pm @@ -0,0 +1,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; |