From: Dave Rolsky Date: Mon, 23 Mar 2009 14:04:43 +0000 (-0500) Subject: docs for MM::Method::Destructor X-Git-Tag: 0.72_01~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bcb81995b1fa725c05fa265de6b4cdd34ed25eea;p=gitmo%2FMoose.git docs for MM::Method::Destructor --- diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index d8f21a2..5f54ce8 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -46,7 +46,6 @@ sub new { ## accessors sub options { (shift)->{'options'} } -sub associated_metaclass { (shift)->{'associated_metaclass'} } ## method @@ -108,28 +107,49 @@ Moose::Meta::Method::Destructor - Method Meta Object for destructors =head1 DESCRIPTION -This is a subclass of L which handles -constructing an appropriate Destructor method. This is primarily -used in the making of immutable metaclasses, otherwise it is -not particularly useful. +This class is a subclass of L that +provides Moose-specific functionality for inlining destructors. + +To understand this class, you should read the the +L documentation as well. + +=head1 INHERITANCE + +C is a subclass of +L I L. =head1 METHODS =over 4 -=item B +=item B<< Moose::Meta;:Method::Destructor->new(%options) >> + +This constructs a new object. It accepts the following options: + +=over 8 -=item B +=item * package_name -=item B +The package for the class in which the destructor is being +inlined. This option is required. -=item B +=item * name -=item B +The name of the destructor method. This option is required. + +=item * metaclass + +The metaclass for the class this destructor belongs to. This is +optional, as it can be set later by calling C<< +$metamethod->attach_to_class >>. + +=back -=item B +=item B<< Moose::Meta;:Method::Destructor->is_needed($metaclass) >> -=item B +Given a L object, this method returns a boolean +indicating whether the class needs a destructor. If the class or any +of its parents defines a C method, it needs a destructor. =back diff --git a/xt/pod_coverage.t b/xt/pod_coverage.t index c615dfc..f71b846 100644 --- a/xt/pod_coverage.t +++ b/xt/pod_coverage.t @@ -46,7 +46,7 @@ my %trustme = ( options ) ], - 'Moose::Meta::Method::Destructor' => ['initialize_body'], + 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ], 'Moose::Role' => [ qw( after around