Commit | Line | Data |
42065130 |
1 | die "Do not use MooseX::HasDefaults, use MooseX::HasDefaults::RO or MooseX::HasDefaults::RW"; |
2 | |
3 | "Screw you Perl, I want to return a true value just to spite you even though it's a load failure. Can we PLEASE get rid of the required module return value? Require modules to die instead, like I just did. SIGH!"; |
4 | |
5 | __END__ |
6 | |
7 | =head1 NAME |
8 | |
9 | MooseX::HasDefaults - default "is" to "ro" or "rw" for all attributes |
10 | |
11 | =head1 SYNOPSIS |
12 | |
13 | package Person; |
14 | use Moose; |
15 | use MooseX::HasDefaults::RO; |
16 | |
17 | has name => ( |
18 | isa => 'Str', |
19 | ); |
20 | |
21 | has age => ( |
22 | is => 'rw', |
23 | isa => 'Int', |
24 | documentation => "Changes most years", |
25 | ); |
26 | |
27 | =head1 DESCRIPTION |
28 | |
0fb18126 |
29 | The module L<MooseX::HasDefaults::RO> defaults C<is> to C<ro>. |
30 | |
31 | The module L<MooseX::HasDefaults::RW> defaults C<is> to C<rw>. |
32 | |
33 | If you pass a specific value to any C<has>'s C<is>, that overrides the default. If you do not want an accessor, pass C<< is => undef >>. |
34 | |
35 | =head1 AUTHOR |
36 | |
37 | Shawn M Moore, C<sartak@gmail.com> |
38 | |
39 | =head1 COPYRIGHT AND LICENSE |
40 | |
41 | Copyright 2009 Infinity Interactive |
42 | |
43 | This program is free software; you can redistribute it and/or modify it |
44 | under the same terms as Perl itself. |
42065130 |
45 | |
46 | =cut |
47 | |