Add my name to spelling whitelist
[gitmo/MooseX-FollowPBP.git] / lib / MooseX / FollowPBP.pm
CommitLineData
a623c113 1package MooseX::FollowPBP;
2
3use strict;
4use warnings;
5
6use Moose 0.94 ();
7use Moose::Exporter;
8use Moose::Util::MetaRole;
9use MooseX::FollowPBP::Role::Attribute;
10
657eec56 11my %metaroles = (
a623c113 12 class_metaroles => {
13 attribute => ['MooseX::FollowPBP::Role::Attribute'],
14 },
15);
16
657eec56 17$metaroles{role_metaroles} = {
18 applied_attribute => ['MooseX::FollowPBP::Role::Attribute'],
19} if $Moose::VERSION >= 1.9900;
20
21Moose::Exporter->setup_import_methods(%metaroles);
22
a623c113 231;
24
25# ABSTRACT: Name your accessors get_foo() and set_foo()
26
27__END__
28
29=pod
30
31=head1 SYNOPSIS
32
a623c113 33 use Moose;
b2d35122 34 use MooseX::FollowPBP;
a623c113 35
36 # make some attributes
37
38=head1 DESCRIPTION
39
40This module does not provide any methods. Simply loading it changes
41the default naming policy for the loading class so that accessors are
42separated into get and set methods. The get methods are prefixed with
43"get_" as the accessor, while set methods are prefixed with
44"set_". This is the naming style recommended by Damian Conway in
45I<Perl Best Practices>.
46
47If you define an attribute with a leading underscore, then both the
48get and set method will also have an underscore prefix.
49
50If you explicitly set a "reader" or "writer" name when creating an
51attribute, then that attribute's naming scheme is left unchanged.
52
070b11b4 53=head1 ACCESSORS IN ROLES
54
55Prior to version 1.9900 of L<Moose>, attributes added to a class ended up with
56that class's attribute traits. That means that if your class used
57C<MooseX::FollowPBP>, any attributes provided by roles you consumed had the
58semi-affordance style of accessor.
59
60As of Moose 1.9900, that is no longer the case. Attributes provided by roles
61no longer acquire the consuming class's attribute traits. However, with Moose
621.9900+, you can now use C<MooseX::FollowPBP> directly in roles. Attributes
63defined by that role will have semi-affordance style accessors, regardless of
64what attribute traits the consuming class has.
65
a623c113 66=head1 BUGS
67
68Please report any bugs or feature requests to
69C<bug-moosex-followpbp@rt.cpan.org>, or through the web interface at
70L<http://rt.cpan.org>. I will be notified, and then you'll
71automatically be notified of progress on your bug as I make changes.
72
73=cut