Doc for Parameter metaclass
[gitmo/MooseX-Role-Parameterized.git] / lib / MooseX / Role / Parameterized / Meta / Parameter.pm
CommitLineData
e476d78d 1package MooseX::Role::Parameterized::Meta::Parameter;
2use Moose;
3extends 'Moose::Meta::Attribute';
4
96bc1fff 5# This doesn't actually do anything because _process_options does not consult
6# the default value of "is". hrm.
7has '+is' => (
8 default => 'ro',
9);
10
11around _process_options => sub {
12 my $orig = shift;
13 my ($class, $name, $options) = @_;
14
15 $options->{is} ||= 'ro';
16
17 $orig->(@_);
18};
e476d78d 19
a3af3850 20__PACKAGE__->meta->make_immutable(
21 inline_constructor => 1,
48db557d 22 replace_constructor => 1,
a3af3850 23 constructor_name => "_new",
24);
e476d78d 25no Moose;
26
271;
28
888ca8e9 29__END__
30
31=head1 NAME
32
33MooseX::Role::Parameterized::Meta::Parameter - metaclass for parameters
34
35=head1 DESCRIPTION
36
37This is the metaclass for parameter objects, a subclass of
38L<Moose::Meta::Attribute>. Its sole purpose is to make the default value
39of the C<is> option C<ro>.
40
41=cut
42