summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-18 04:34:22 -0500
committerdoy <doy@tozt.net>2008-12-18 04:34:22 -0500
commit2c7815054183d3b64d624c743ca622d812cc55dc (patch)
tree79bb3171ed9eb27a117a8955fa7ecca1b47bdc2a /lib/Bot/Games.pm
parent1f0be072af489985f0db8c3a67f9636badd8c4d0 (diff)
downloadbot-games-2c7815054183d3b64d624c743ca622d812cc55dc.tar.gz
bot-games-2c7815054183d3b64d624c743ca622d812cc55dc.zip
print complex data structures better
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index de05386..dc1083e 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -66,6 +66,18 @@ sub said {
}
return $output;
}
+around said => sub {
+ my $orig = shift;
+ my $self = shift;
+ my $ret = $self->$orig(@_);
+ if (blessed $ret) {
+ $ret = "$ret";
+ }
+ elsif (ref($ret) && ref($ret) eq 'ARRAY') {
+ $ret = join ', ', @$ret;
+ }
+ return $ret;
+};
sub valid_game {
my $self = shift;