Commit | Line | Data |
7adfd53f |
1 | package Reaction::Meta::Attribute; |
2 | |
3 | use Moose; |
4 | |
5 | extends 'Moose::Meta::Attribute'; |
6 | |
7f43bb45 |
7 | with 'Reaction::Role::Meta::Attribute'; |
7adfd53f |
8 | |
7f43bb45 |
9 | no Moose; |
905a0946 |
10 | |
7f43bb45 |
11 | #__PACKAGE__->meta->make_immutable(inline_constructor => 0); |
a5200252 |
12 | |
7adfd53f |
13 | 1; |
14 | |
15 | __END__; |
16 | |
17 | =head1 NAME |
18 | |
19 | Reaction::Meta::Attribute |
20 | |
21 | =head1 SYNOPSIS |
22 | |
23 | has description => (is => 'rw', isa => 'Str', lazy_fail => 1); |
24 | |
7adfd53f |
25 | =head1 Method-naming conventions |
26 | |
27 | Reaction::Meta::Attribute will never override the values you set for method names, |
28 | but if you do not it will follow these basic rules: |
29 | |
30 | Attributes with a name that starts with an underscore will default to using |
31 | builder and predicate method names in the form of the attribute name preceeded by |
32 | either "_has" or "_build". Otherwise the method names will be in the form of the |
33 | attribute names preceeded by "has_" or "build_". e.g. |
34 | |
35 | #auto generates "_has_description" and expects "_build_description" |
89939ff9 |
36 | has _description => (is => 'rw', isa => 'Str', lazy_fail => 1); |
7adfd53f |
37 | |
38 | #auto generates "has_description" and expects "build_description" |
89939ff9 |
39 | has description => (is => 'rw', isa => 'Str', lazy_fail => 1); |
7adfd53f |
40 | |
41 | =head2 Predicate generation |
42 | |
43 | All non-required or lazy attributes will have a predicate automatically |
44 | generated for them if one is not already specified. |
45 | |
46 | =head2 lazy_fail |
47 | |
89939ff9 |
48 | lazy_fail will fail if it is called without first having set the value. |
7adfd53f |
49 | |
50 | =head1 AUTHORS |
51 | |
52 | See L<Reaction::Class> for authors. |
53 | |
54 | =head1 LICENSE |
55 | |
56 | See L<Reaction::Class> for the license. |
57 | |
58 | =cut |