From: Tokuhiro Matsuno Date: Fri, 10 Apr 2009 04:49:19 +0000 (+0900) Subject: class-mop says 'The compute_all_applicable_attributes method has been deprecated.' X-Git-Tag: 0.21~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0eaf53c27a3ef11c0a515a91df229d10bf29b58d;p=gitmo%2FMouse.git class-mop says 'The compute_all_applicable_attributes method has been deprecated.' --- diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index 75f589d..8d110da 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -6,7 +6,7 @@ sub generate_constructor_method_inline { my ($class, $meta) = @_; my $associated_metaclass_name = $meta->name; - my @attrs = $meta->compute_all_applicable_attributes; + my @attrs = $meta->get_all_attributes; my $buildall = $class->_generate_BUILDALL($meta); my $buildargs = $class->_generate_BUILDARGS($meta); my $processattrs = $class->_generate_processattrs($meta, \@attrs); diff --git a/lib/Mouse/Object.pm b/lib/Mouse/Object.pm index bac4fa0..217b7dc 100644 --- a/lib/Mouse/Object.pm +++ b/lib/Mouse/Object.pm @@ -12,7 +12,7 @@ sub new { my $instance = bless {}, $class; - for my $attribute ($class->meta->compute_all_applicable_attributes) { + for my $attribute ($class->meta->get_all_attributes) { my $from = $attribute->init_arg; my $key = $attribute->name; diff --git a/t/028-subclass-attr.t b/t/028-subclass-attr.t index eaeb283..ca221d0 100644 --- a/t/028-subclass-attr.t +++ b/t/028-subclass-attr.t @@ -26,10 +26,10 @@ my $obj = Child->new(class => 1, child => 1); ok($obj->child, "local attribute set in constructor"); ok($obj->class, "inherited attribute set in constructor"); -is_deeply([Child->meta->compute_all_applicable_attributes], [ +is_deeply([Child->meta->get_all_attributes], [ Child->meta->get_attribute('child'), Class->meta->get_attribute('class'), -], "correct compute_all_applicable_attributes"); +], "correct get_all_attributes"); do { package Foo; @@ -61,11 +61,11 @@ is(Foo->meta->get_attribute('attr')->_is_metadata, 'ro'); is(Bar->meta->get_attribute('attr')->default, undef); is(Bar->meta->get_attribute('attr')->_is_metadata, 'rw'); -is_deeply([Foo->meta->compute_all_applicable_attributes], [ +is_deeply([Foo->meta->get_all_attributes], [ Foo->meta->get_attribute('attr'), -], "correct compute_all_applicable_attributes"); +], "correct get_all_attributes"); -is_deeply([Bar->meta->compute_all_applicable_attributes], [ +is_deeply([Bar->meta->get_all_attributes], [ Bar->meta->get_attribute('attr'), -], "correct compute_all_applicable_attributes"); +], "correct get_all_attributes"); diff --git a/t/500_moose_extends_mouse.t b/t/500_moose_extends_mouse.t index 4a79e7d..bcb51dd 100644 --- a/t/500_moose_extends_mouse.t +++ b/t/500_moose_extends_mouse.t @@ -84,7 +84,7 @@ is( eval { $bar->bar }, undef, "no default value" ); is_deeply( - [ sort map { $_->name } Bar->meta->compute_all_applicable_attributes ], + [ sort map { $_->name } Bar->meta->get_all_attributes ], [ sort qw(foo bar) ], "attributes", );