summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/OO/Game.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bot/Games/OO/Game.pm')
-rw-r--r--lib/Bot/Games/OO/Game.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Bot/Games/OO/Game.pm b/lib/Bot/Games/OO/Game.pm
index 0bc294a..2da71bd 100644
--- a/lib/Bot/Games/OO/Game.pm
+++ b/lib/Bot/Games/OO/Game.pm
@@ -30,7 +30,12 @@ sub command {
$class->meta->add_method($name, $method_meta);
}
for my $attr (map { $_->meta->get_attribute_list } @method_metaclass_roles) {
- $method_meta->$attr($args{$attr}) if exists $args{$attr};
+ next unless exists $args{$attr};
+ my $value = $args{$attr};
+ my $munge_method = "_munge_$attr";
+ $value = $method_meta->$munge_method($value)
+ if $method_meta->can($munge_method);
+ $method_meta->$attr($value);
}
}