update copyright year
[gitmo/MooseX-SemiAffordanceAccessor.git] / lib / MooseX / SemiAffordanceAccessor.pm
CommitLineData
b95d9f9b 1package MooseX::SemiAffordanceAccessor;
2
3use strict;
4use warnings;
5
6our $VERSION = '0.03';
7
1a0388e6 8use Moose 0.5504 ();
b95d9f9b 9use Moose::Exporter;
10use Moose::Util::MetaRole;
11use MooseX::SemiAffordanceAccessor::Role::Attribute;
12
13# The main reason to use this is to ensure that we get the right value
14# in $p{for_class} later.
15Moose::Exporter->setup_import_methods();
16
17
18sub init_meta
19{
20 shift;
21 my %p = @_;
22
23 Moose->init_meta(%p);
24
25 return
26 Moose::Util::MetaRole::apply_metaclass_roles
27 ( for_class => $p{for_class},
28 attribute_metaclass_roles =>
29 ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
30 );
31}
32
33
341;
35
36__END__
37
38=pod
39
40=head1 NAME
41
42MooseX::SemiAffordanceAccessor - Name your accessors foo() and set_foo()
43
44=head1 SYNOPSIS
45
46 use MooseX::SemiAffordanceAccessor;
47 use Moose;
48
49 # make some attributes
50
51=head1 DESCRIPTION
52
53This module does not provide any methods. Simply loading it changes
54the default naming policy for the loading class so that accessors are
55separated into get and set methods. The get methods have the same name
56as the accessor, while set methods are prefixed with "set_".
57
58If you define an attribute with a leading underscore, then the set
59method will start with "_set_".
60
61If you explicitly set a "reader" or "writer" name when creating an
62attribute, then that attribute's naming scheme is left unchanged.
63
64The name "semi-affordance" comes from David Wheeler's Class::Meta
65module.
66
67=head1 AUTHOR
68
69Dave Rolsky, C<< <autarch@urth.org> >>
70
71=head1 BUGS
72
73Please report any bugs or feature requests to
74C<bug-moosex-semiaffordanceaccessor@rt.cpan.org>, or through
75the web interface at L<http://rt.cpan.org>. I will be notified, and
76then you'll automatically be notified of progress on your bug as I
77make changes.
78
79=head1 COPYRIGHT & LICENSE
80
31d1505c 81Copyright 2007-2008 Dave Rolsky, All Rights Reserved.
b95d9f9b 82
83This program is free software; you can redistribute it and/or modify
84it under the same terms as Perl itself.
85
86=cut