Only use applied_attribute metarole with new Moose
[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 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