factor out metaclass info into roles for compatibility
[catagits/Reaction.git] / lib / Reaction / Meta / Attribute.pm
CommitLineData
7adfd53f 1package Reaction::Meta::Attribute;
2
3use Moose;
4
5extends 'Moose::Meta::Attribute';
6
7f43bb45 7with 'Reaction::Role::Meta::Attribute';
7adfd53f 8
7f43bb45 9no Moose;
905a0946 10
7f43bb45 11#__PACKAGE__->meta->make_immutable(inline_constructor => 0);
a5200252 12
7adfd53f 131;
14
15__END__;
16
17=head1 NAME
18
19Reaction::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
27Reaction::Meta::Attribute will never override the values you set for method names,
28but if you do not it will follow these basic rules:
29
30Attributes with a name that starts with an underscore will default to using
31builder and predicate method names in the form of the attribute name preceeded by
32either "_has" or "_build". Otherwise the method names will be in the form of the
33attribute 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
43All non-required or lazy attributes will have a predicate automatically
44generated for them if one is not already specified.
45
46=head2 lazy_fail
47
89939ff9 48lazy_fail will fail if it is called without first having set the value.
7adfd53f 49
50=head1 AUTHORS
51
52See L<Reaction::Class> for authors.
53
54=head1 LICENSE
55
56See L<Reaction::Class> for the license.
57
58=cut