Subject: | class_has "handles => {}" option does not play well with Meta::Attribute::Native::Trait::Array |
Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010
x86_64 GNU/Linux
This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi
Distribution DROLSKY/MooseX-ClassAttribute-0.13.tar.gz
class_has handles => { 'count_data' => 'count', ... } does not play well
with Meta::Attribute::Native::Trait::Array
When I want to use the methods provided by the handles => {} option I
get messages like this just because it is a class attribute:
Cannot delegate count_data to count because the value of data is not an
object (got 'ARRAY(0x5366638)')
plus "stacktrace" ... omitted here
The Attribute 'data', defined in my class as
class_has 'data' => (
is => 'rw',
isa => 'ArrayRef',
writer => 'set_data',
clearer => 'clear_data',
predicate => 'has_data',
default => sub { [] },
lazy => 1,
handles => {
'count_data' => 'count',
'elements_data' => 'elements',
'uniq_data' => 'uniq',
'map_data' => 'map',
},
);