From: Dave Rolsky Date: Tue, 17 Mar 2009 15:05:14 +0000 (-0500) Subject: docs for CMOP::Method::Accessor X-Git-Tag: 0.78_01~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=806f6da408787e019aa0ced4313f255682a1c35f;p=gitmo%2FClass-MOP.git docs for CMOP::Method::Accessor --- diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm index 834b0e8..bd88bf3 100644 --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@ -226,86 +226,58 @@ Class::MOP::Method::Accessor - Method Meta Object for accessors =head1 DESCRIPTION -This is a C subclass which is used interally -by C to generate accessor code. It can -handle generation of readers, writers, predicate and clearer -methods, both as closures and as more optimized inline methods. +This is a subclass of which is used by +C to generate accessor code. It handles +generation of readers, writers, predicates and clearers. For each type +of method, it can either create a subroutine reference, or actually +inline code by generating a string and C'ing it. =head1 METHODS =over 4 -=item B +=item B<< Class::MOP::Method::Accessor->new(%options) >> -This creates the method based on the criteria in C<%options>, -these options are: +This returns a new C based on the +C<%options> provided. =over 4 -=item I +=item attribute -This must be an instance of C which this -accessor is being generated for. This paramter is B. +This is the C for which accessors are being +generated. This option is required. -=item I +=item accessor_type -This is a string from the following set; reader, writer, accessor, -predicate or clearer. This is used to determine which type of -method is to be generated. +This is a string which should be one of "reader", "writer", +"accessor", "predicate", or "clearer". This is the type of method +being generated. This option is required. -=item I +=item is_inline -This is a boolean to indicate if the method should be generated -as a closure, or as a more optimized inline version. +This indicates whether or not the accessor should be inlined. This +default to false. =back -=item B +=item B<< $metamethod->accessor_type >> -This returns the accessor type which was passed into C. +Returns the accessor type which was passed to C. -=item B +=item B<< $metamethod->is_inline >> -This returns the boolean which was passed into C. +Returns a boolean indicating whether or not the accessor is inlined. -=item B +=item B<< $metamethod->associated_attribute >> -This returns the attribute instance which was passed into C. +This returns the L object which was passed to +C. -=item B +=item B<< $metamethod->body >> -This will actually generate the method based on the specified -criteria passed to the constructor. - -=back - -=head2 Method Generators - -These methods will generate appropriate code references for -the various types of accessors which are supported by -C. The names pretty much explain it all. - -=over 4 - -=item B - -=item B - -=item B - -=item B - -=item B - -=item B - -=item B - -=item B - -=item B - -=item B +The method itself is I when the accessor object is +constructed. =back diff --git a/xt/pod_coverage.t b/xt/pod_coverage.t index 3f95f67..1db4714 100644 --- a/xt/pod_coverage.t +++ b/xt/pod_coverage.t @@ -58,6 +58,21 @@ my %trustme = ( bless_instance_structure is_dependent_on_superclasses ), ], + + 'Class::MOP::Method::Accessor' => [ + qw( generate_accessor_method + generate_accessor_method_inline + generate_clearer_method + generate_clearer_method_inline + generate_predicate_method + generate_predicate_method_inline + generate_reader_method + generate_reader_method_inline + generate_writer_method + generate_writer_method_inline + initialize_body + ) + ], ); for my $module ( sort @modules ) { diff --git a/xt/pod_spell.t b/xt/pod_spell.t index 2609cdd..4f17275 100644 --- a/xt/pod_spell.t +++ b/xt/pod_spell.t @@ -88,6 +88,7 @@ Metalevel API APIs Baz +clearers continutation datetimes definedness