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