summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-26 23:24:28 -0500
committerdoy <doy@tozt.net>2009-04-26 23:24:28 -0500
commitb71105b36a57855650fca6761d177ec45f81eb20 (patch)
treeb63082994064e8c4f48ac46152470aec25fd3f42
parente7148b49978b3e5888c070680d22dd3a7707e6d2 (diff)
downloadbot-games-b71105b36a57855650fca6761d177ec45f81eb20.tar.gz
bot-games-b71105b36a57855650fca6761d177ec45f81eb20.zip
_process_options is called before the attribute is actually instantiated
-rw-r--r--lib/Bot/Games/Trait/Attribute/Formatted.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Bot/Games/Trait/Attribute/Formatted.pm b/lib/Bot/Games/Trait/Attribute/Formatted.pm
index ca4776f..c039fc7 100644
--- a/lib/Bot/Games/Trait/Attribute/Formatted.pm
+++ b/lib/Bot/Games/Trait/Attribute/Formatted.pm
@@ -33,14 +33,14 @@ before _process_options => sub {
};
after _process_options => sub {
- my $self = shift;
+ my $class = shift;
my ($name, $options) = @_;
return if exists $options->{formatter};
if (exists $options->{type_constraint}) {
my $tc = $options->{type_constraint};
for my $tc_type (keys %default_formatters) {
if ($tc->is_a_type_of($tc_type)) {
- $self->formatter($default_formatters{$tc_type});
+ $options->{formatter} = $default_formatters{$tc_type};
}
}
}