Commit | Line | Data |
a623c113 |
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 | |
657eec56 |
11 | my %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 | |
21 | Moose::Exporter->setup_import_methods(%metaroles); |
22 | |
a623c113 |
23 | 1; |
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 | |
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 BUGS |
54 | |
55 | Please report any bugs or feature requests to |
56 | C<bug-moosex-followpbp@rt.cpan.org>, or through the web interface at |
57 | L<http://rt.cpan.org>. I will be notified, and then you'll |
58 | automatically be notified of progress on your bug as I make changes. |
59 | |
60 | =cut |