From b71105b36a57855650fca6761d177ec45f81eb20 Mon Sep 17 00:00:00 2001 From: doy Date: Sun, 26 Apr 2009 23:24:28 -0500 Subject: _process_options is called before the attribute is actually instantiated --- lib/Bot/Games/Trait/Attribute/Formatted.pm | 4 ++-- 1 file 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}; } } } -- cgit v1.2.3-54-g00ecf