X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=ae69e32fb9fd1e5199ea870a8734e2fb13bf466d;hb=cc7cd81f082a9aaa3dd17ca07dbb91da28bd0b69;hp=24559c4e484b0d48ee55554ad0e44e5d9b31f6a6;hpb=bf1c5d5c92ddde0cfaef2f9489d7a743216e5933;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 24559c4..ae69e32 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -3,15 +3,14 @@ use Mouse::Util qw/:meta get_linear_isa not_supported/; # enables strict and war use Scalar::Util qw/blessed weaken/; -use Mouse::Meta::Method::Destructor; use Mouse::Meta::Module; our @ISA = qw(Mouse::Meta::Module); sub method_metaclass() { 'Mouse::Meta::Method' } sub attribute_metaclass() { 'Mouse::Meta::Attribute' } -sub constructor_class(); # XS -sub destructor_class() { 'Mouse::Meta::Method::Destructor' } +sub constructor_class(); +sub destructor_class(); sub _construct_meta { my($class, %args) = @_; @@ -199,13 +198,17 @@ sub make_immutable { $self->{is_immutable}++; if ($args{inline_constructor}) { + my $c = $self->constructor_class; + Mouse::Util::load_class($c); $self->add_method($args{constructor_name} => - $self->constructor_class->_generate_constructor($self, \%args)); + $c->_generate_constructor($self, \%args)); } if ($args{inline_destructor}) { + my $c = $self->destructor_class; + Mouse::Util::load_class($c); $self->add_method(DESTROY => - $self->destructor_class->_generate_destructor($self, \%args)); + $c->_generate_destructor($self, \%args)); } # Moose's make_immutable returns true allowing calling code to skip setting an explicit true value @@ -407,7 +410,7 @@ Mouse::Meta::Class - The Mouse class metaclass =head1 VERSION -This document describes Mouse version 0.40_05 +This document describes Mouse version 0.40_06 =head1 METHODS