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