f1a5834c074674e9522ebb5ae1b9bbcfab3b0988
[gitmo/MooseX-SemiAffordanceAccessor.git] / lib / MooseX / SemiAffordanceAccessor.pm
1 package MooseX::SemiAffordanceAccessor;
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::SemiAffordanceAccessor::Role::Attribute;
10
11 Moose::Exporter->setup_import_methods(
12     class_metaroles => {
13         attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
14     },
15     role_metaroles => {
16         applied_attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
17     },
18 );
19
20 1;
21
22 # ABSTRACT: Name your accessors foo() and set_foo()
23
24 __END__
25
26 =pod
27
28 =head1 SYNOPSIS
29
30     use Moose;
31     use MooseX::SemiAffordanceAccessor;
32
33     # make some attributes
34
35 =head1 DESCRIPTION
36
37 This module does not provide any methods. Simply loading it changes
38 the default naming policy for the loading class so that accessors are
39 separated into get and set methods. The get methods have the same name
40 as the accessor, while set methods are prefixed with "set_".
41
42 If you define an attribute with a leading underscore, then the set
43 method will start with "_set_".
44
45 If you explicitly set a "reader" or "writer" name when creating an
46 attribute, then that attribute's naming scheme is left unchanged.
47
48 The name "semi-affordance" comes from David Wheeler's Class::Meta
49 module.
50
51 =head1 BUGS
52
53 Please report any bugs or feature requests to
54 C<bug-moosex-semiaffordanceaccessor@rt.cpan.org>, or through
55 the web interface at L<http://rt.cpan.org>.  I will be notified, and
56 then you'll automatically be notified of progress on your bug as I
57 make changes.
58
59 =cut