diff options
author | doy <doy@tozt.net> | 2009-04-26 23:24:28 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-04-26 23:24:28 -0500 |
commit | b71105b36a57855650fca6761d177ec45f81eb20 (patch) | |
tree | b63082994064e8c4f48ac46152470aec25fd3f42 | |
parent | e7148b49978b3e5888c070680d22dd3a7707e6d2 (diff) | |
download | bot-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.pm | 4 |
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}; } } } |