1 package MooseX::SemiAffordanceAccessor;
10 use Moose::Util::MetaRole;
11 use MooseX::SemiAffordanceAccessor::Role::Attribute;
13 # The main reason to use this is to ensure that we get the right value
14 # in $p{for_class} later.
15 Moose::Exporter->setup_import_methods();
26 Moose::Util::MetaRole::apply_metaclass_roles
27 ( for_class => $p{for_class},
28 attribute_metaclass_roles =>
29 ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
42 MooseX::SemiAffordanceAccessor - Name your accessors foo() and set_foo()
46 use MooseX::SemiAffordanceAccessor;
49 # make some attributes
53 This module does not provide any methods. Simply loading it changes
54 the default naming policy for the loading class so that accessors are
55 separated into get and set methods. The get methods have the same name
56 as the accessor, while set methods are prefixed with "set_".
58 If you define an attribute with a leading underscore, then the set
59 method will start with "_set_".
61 If you explicitly set a "reader" or "writer" name when creating an
62 attribute, then that attribute's naming scheme is left unchanged.
64 The name "semi-affordance" comes from David Wheeler's Class::Meta
69 Dave Rolsky, C<< <autarch@urth.org> >>
73 Please report any bugs or feature requests to
74 C<bug-moosex-semiaffordanceaccessor@rt.cpan.org>, or through
75 the web interface at L<http://rt.cpan.org>. I will be notified, and
76 then you'll automatically be notified of progress on your bug as I
79 =head1 COPYRIGHT & LICENSE
81 Copyright 2007 Dave Rolsky, All Rights Reserved.
83 This program is free software; you can redistribute it and/or modify
84 it under the same terms as Perl itself.