diff options
author | doy <doy@tozt.net> | 2008-12-18 03:47:20 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-18 03:47:20 -0500 |
commit | 1e43c81a11a69742d4c91c24c6168659741b8135 (patch) | |
tree | 91ea23fddf91130f4eaab05a4c8658ca65a81416 /lib/Bot/Games.pm | |
parent | c3399233ebef1c7608aabcb710fac774361d1d6b (diff) | |
download | bot-games-1e43c81a11a69742d4c91c24c6168659741b8135.tar.gz bot-games-1e43c81a11a69742d4c91c24c6168659741b8135.zip |
parse out prefix from the constructor parameters
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r-- | lib/Bot/Games.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm index 2810506..843f2d4 100644 --- a/lib/Bot/Games.pm +++ b/lib/Bot/Games.pm @@ -22,6 +22,16 @@ has active_games => ( default => sub { {} }, ); +around new => sub { + my $orig = shift; + my $class = shift; + my %args = @_; + my $prefix = delete $args{prefix}; + my $self = $class->$orig(%args); + $self->prefix($prefix) if $prefix; + return $self; +}; + sub said { my $self = shift; my ($args) = @_; |