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();
25 Moose::Util::MetaRole::apply_metaclass_roles
26 ( for_class => $p{for_class},
27 attribute_metaclass_roles =>
28 ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
40 MooseX::SemiAffordanceAccessor - Name your accessors foo() and set_foo()
44 use MooseX::SemiAffordanceAccessor;
47 # make some attributes
51 This module does not provide any methods. Simply loading it changes
52 the default naming policy for the loading class so that accessors are
53 separated into get and set methods. The get methods have the same name
54 as the accessor, while set methods are prefixed with "set_".
56 If you define an attribute with a leading underscore, then the set
57 method will start with "_set_".
59 If you explicitly set a "reader" or "writer" name when creating an
60 attribute, then that attribute's naming scheme is left unchanged.
62 The name "semi-affordance" comes from David Wheeler's Class::Meta
67 Dave Rolsky, C<< <autarch@urth.org> >>
71 Please report any bugs or feature requests to
72 C<bug-moosex-semiaffordanceaccessor@rt.cpan.org>, or through
73 the web interface at L<http://rt.cpan.org>. I will be notified, and
74 then you'll automatically be notified of progress on your bug as I
77 =head1 COPYRIGHT & LICENSE
79 Copyright 2007-2008 Dave Rolsky, All Rights Reserved.
81 This program is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.