Class-Accessor-Installer

 view release on metacpan or  search on metacpan

lib/Class/Accessor/Installer.pm  view on Meta::CPAN


=back

The installed subroutine is named using L<Sub::Name>, so it shows up with a
meaningful name in stack traces (instead of as C<__ANON__>). However, the
inside the debugger, the subroutine still shows up as C<__ANON__>. You might
therefore want to use the following lines at the beginning of your subroutine:

        $self->install_accessor(
            name => $field,
            code => sub {
                local $DB::sub = local *__ANON__ = "${class}::${field}"
                    if defined &DB::DB && !$Devel::DProf::VERSION;
                ...
        );

Now the subroutine will be named both in a stack trace and inside the
debugger.

=head2 document_accessor

Adds documentation for an accessor - not necessarily one that has been
generated with C<install_accessor()>. See L<Sub::Documentation> for details.

Takes as arguments a named hash. The following keys are recognized:

=over 4

=item C<package>

Like the C<package> argument of C<install_accessor()>.

=item C<name>

The name of the accessor being documented. This can be a string or a reference
to an array of strings, if the same documentation applies to more than one
method. This can occur, for example, when there are aliases for a method such
as C<clear_foo()> and C<foo_clear()>.

=item C<purpose>

A string describing the generated method.

=item C<examples>

An array reference containing one or more examples of using the method. These
will also be used in the generated documentation.

=back

You can pass additional arbitrary key/value pairs; they will be stored as
well. It depends on your documentation tool which keys are useful. For
example, L<Class::Accessor::Complex> generates and
L<Pod::Weaver::Section::CollectWithAutoDoc> supports a C<belongs_to> key that
shows which generated helper method belongs to which main accessor.

=head1 INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at
L<http://rt.cpan.org/Public/Dist/Display.html?Name=Class-Accessor-Installer>.

=head1 AVAILABILITY

The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
site near you, or see
L<http://search.cpan.org/dist/Class-Accessor-Installer/>.

The development version lives at
L<http://github.com/hanekomu/Class-Accessor-Installer/>.
Instead of sending patches, please fork this project using the standard git
and github infrastructure.

=head1 AUTHORS

  Marcel Gruenauer <marcel@cpan.org>
  Florian Helmberger <florian@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2007 by Marcel Gruenauer.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 1.051 second using v1.01-cache-2.11-cpan-39bf76dae61 )