up
[gitmo/Moose.git] / lib / Moose / Object.pm
index 3639c56..cf08065 100644 (file)
@@ -3,12 +3,13 @@ package Moose::Object;
 
 use strict;
 use warnings;
-
 use metaclass 'Moose::Meta::Class' => (
        ':attribute_metaclass' => 'Moose::Meta::Attribute'
 );
 
-our $VERSION = '0.01';
+use Carp 'confess';
+
+our $VERSION = '0.02';
 
 sub new {
     my $class  = shift;
@@ -21,14 +22,14 @@ sub new {
 sub BUILDALL {
        my ($self, %params) = @_;
        foreach my $method ($self->meta->find_all_methods_by_name('BUILD')) {
-               $method->{method}->($self, %params);
+               $method->{code}->($self, %params);
        }
 }
 
 sub DEMOLISHALL {
        my $self = shift;
        foreach my $method ($self->meta->find_all_methods_by_name('DEMOLISH')) {
-               $method->{method}->($self);
+               $method->{code}->($self);
        }       
 }
 
@@ -66,6 +67,8 @@ This will call every C<BUILD> method in the inheritance hierarchy.
 
 This will call every C<DEMOLISH> method in the inheritance hierarchy.
 
+=item B<NEXT>
+
 =back
 
 =head1 BUGS